OscFit::ThreeFlavourFitter Class Reference

#include <ThreeFlavourFitter.h>

List of all members.

Public Member Functions

void SetFileName (const char *filename)
void BuildExpt ()
void BuildExptFromData ()
void BuildExptFromMC ()
void WriteExpt ()
void PrintExpt ()
void ResetExpt ()
Bool_t TouchExpt ()
Int_t GenSeed ()
void SetSeed (Int_t seed=-1)
Int_t GetDmsqBins ()
Double_t GetDmsqMin ()
Double_t GetDmsqMax ()
Double_t GetDmsq (Int_t n)
Int_t GetSinsq23Bins ()
Double_t GetSinsq23Min ()
Double_t GetSinsq23Max ()
Double_t GetSinsq23 (Int_t n)
Int_t GetSinsq13Bins ()
Double_t GetSinsq13Min ()
Double_t GetSinsq13Max ()
Double_t GetSinsq13 (Int_t n)
Int_t GetDeltaCPBins ()
Double_t GetDeltaCPMin ()
Double_t GetDeltaCPMax ()
Double_t GetDeltaCP (Int_t n)
Bool_t UsingDmsq ()
Bool_t UsingSinsq23 ()
Bool_t UsingSinsq13 ()
Bool_t UsingDeltaCP ()
void BuildGrid ()
void BuildGridDmsq ()
void BuildGridSinsq23 ()
void BuildGridSinsq13 ()
void BuildGridDeltaCP ()
void BuildGridDmsq (Int_t n, Double_t min, Double_t max)
void BuildGridSinsq23 (Int_t n, Double_t min, Double_t max)
void BuildGridSinsq13 (Int_t n, Double_t min, Double_t max)
void BuildGridDeltaCP (Int_t n, Double_t min, Double_t max)
void PrintGrid ()
void SetRealData ()
void SetMockData ()
void SetMockDataWithFluctuations ()
void ApplyExternalConstraintOnSinsq13 ()
void SetExternalConstraintOnSinsq13 (Double_t sinsqThetaError)
void SetExternalConstraintOnSinsq13 (Double_t sinsqTheta, Double_t sinsqThetaError)
void UseExternalData (Bool_t yesno=1)
void AddPenaltyTerms (Bool_t yesno=1)
void PenaltyTermsOff ()
void SetOscillations (Double_t dmsq, Double_t sinsq23, Double_t sinsq13, Double_t deltaCP)
void SetSeedOscillations (Double_t dmsq, Double_t sinsq23, Double_t sinsq13, Double_t deltaCP)
void SetInputOscillations (Double_t dmsq, Double_t sinsq23, Double_t sinsq13, Double_t deltaCP)
void SetSystematics (Double_t beam_numu_norm, Double_t beam_numu_ncbkg, Double_t beam_numu_shwen, Double_t beam_numu_trken, Double_t beam_numu_trken_exit, Double_t beam_nue_norm, Double_t beam_nue_ncbkg, Double_t beam_nue_energy, Double_t atmos_norm_cv, Double_t atmos_norm_rock, Double_t atmos_chg_cv, Double_t atmos_chg_rock, Double_t atmos_nue_norm, Double_t atmos_nue_ratio, Double_t atmos_ncbkg, Double_t atmos_spec_cv_numu, Double_t atmos_spec_cv_numubar, Double_t atmos_spec_cv_nue, Double_t atmos_spec_cv_nuebar, Double_t atmos_spec_rock_nu, Double_t atmos_spec_rock_nubar, Double_t atmos_zenith, Double_t atmos_numu_trken, Double_t atmos_numu_trken_exit, Double_t atmos_numu_shwen, Double_t atmos_nue_energy)
void SetInputSystematics (Double_t beam_numu_norm, Double_t beam_numu_ncbkg, Double_t beam_numu_shwen, Double_t beam_numu_trken, Double_t beam_numu_trken_exit, Double_t beam_nue_norm, Double_t beam_nue_ncbkg, Double_t beam_nue_energy, Double_t atmos_norm_cv, Double_t atmos_norm_rock, Double_t atmos_chg_cv, Double_t atmos_chg_rock, Double_t atmos_nue_norm, Double_t atmos_nue_ratio, Double_t atmos_ncbkg, Double_t atmos_spec_cv_numu, Double_t atmos_spec_cv_numubar, Double_t atmos_spec_cv_nue, Double_t atmos_spec_cv_nuebar, Double_t atmos_spec_rock_nu, Double_t atmos_spec_rock_nubar, Double_t atmos_zenith, Double_t atmos_numu_trken, Double_t atmos_numu_trken_exit, Double_t atmos_numu_shwen, Double_t atmos_nue_energy)
void SetBeamSystematics (Double_t beam_numu_norm, Double_t beam_numu_ncbkg, Double_t beam_numu_shwen, Double_t beam_numu_trken, Double_t beam_numu_trken_exit, Double_t beam_nue_norm, Double_t beam_nue_ncbkg, Double_t beam_nue_energy)
void SetAtmosSystematics (Double_t atmos_norm_cv, Double_t atmos_norm_rock, Double_t atmos_chg_cv, Double_t atmos_chg_rock, Double_t atmos_nue_norm, Double_t atmos_nue_ratio, Double_t atmos_ncbkg, Double_t atmos_spec_cv_numu, Double_t atmos_spec_cv_numubar, Double_t atmos_spec_cv_nue, Double_t atmos_spec_cv_nuebar, Double_t atmos_spec_rock_nu, Double_t atmos_spec_rock_nubar, Double_t atmos_zenith, Double_t atmos_numu_trken, Double_t atmos_numu_trken_exit, Double_t atmos_numu_shwen, Double_t atmos_nue_energy)
void ResetFit ()
void FitOscillations (Bool_t yesno=true)
void FitSystematics (Bool_t yesno=true)
void FitCorrelatedSystematics (Bool_t yesno=true)
void SwitchOnCorrelatedSystematics ()
void SwitchOffCorrelatedSystematics ()
void FixOctant (Bool_t yesno=true)
void SplitDeltaCP (Bool_t yesno=true)
void SplitSinsq23 (Bool_t yesno=true)
void FitHierarchy (Bool_t fitme=true)
void FitDmsq (Bool_t fitme=true)
void FitSinsq23 (Bool_t fitme=true)
void FitSinsq13 (Bool_t fitme=true)
void FitDeltaCP (Bool_t fitme=true)
void FitSinsq13WithExternalConstraint ()
void FitBeamNumuNorm (Bool_t fitme=true)
void FitBeamNumuNCBkg (Bool_t fitme=true)
void FitBeamNumuShwEn (Bool_t fitme=true)
void FitBeamNumuTrkEn (Bool_t fitme=true)
void FitBeamNumuTrkEnExit (Bool_t fitme=true)
void FitBeamNueNorm (Bool_t fitme=true)
void FitBeamNueNCBkg (Bool_t fitme=true)
void FitBeamNueEnergy (Bool_t fitme=true)
void FitAtmosNormCV (Bool_t fitme=true)
void FitAtmosNormRock (Bool_t fitme=true)
void FitAtmosChgCV (Bool_t fitme=true)
void FitAtmosChgRock (Bool_t fitme=true)
void FitAtmosNueNorm (Bool_t fitme=true)
void FitAtmosNueRatio (Bool_t fitme=true)
void FitAtmosNCBkg (Bool_t fitme=true)
void FitAtmosSpecNumuCV (Bool_t fitme=true)
void FitAtmosSpecNumuBarCV (Bool_t fitme=true)
void FitAtmosSpecNueCV (Bool_t fitme=true)
void FitAtmosSpecNueBarCV (Bool_t fitme=true)
void FitAtmosSpecNuRock (Bool_t fitme=true)
void FitAtmosSpecNuBarRock (Bool_t fitme=true)
void FitAtmosZenith (Bool_t fitme=true)
void FitAtmosNumuTrkEn (Bool_t fitme=true)
void FitAtmosNumuTrkEnExit (Bool_t fitme=true)
void FitAtmosNumuShwEn (Bool_t fitme=true)
void FitAtmosNueEnergy (Bool_t fitme=true)
void SwitchOnBoundaries ()
void SwitchOffBoundaries ()
void SetDebug (Bool_t yesno=1)
Bool_t Debugging ()
void WriteTemplates (Bool_t yesno=1)
void PrintSettings ()
Double_t GetLikelihood (Double_t input_dmsq, Double_t input_sinsq23, Double_t input_sinsq13, Double_t input_deltaCP)
Double_t GetLikelihood (Double_t input_dmsq, Double_t input_sinsq23, Double_t input_sinsq13, Double_t input_deltaCP, Double_t &osc_dmsq, Double_t &osc_sinsq23, Double_t &osc_sinsq13, Double_t &osc_deltaCP)
void GetLikelihoods (Double_t &lnl_normal_lower, Double_t &lnl_normal_upper, Double_t &lnl_inverted_lower, Double_t &lnl_inverted_upper)
Double_t GetLikelihoodDifferenceForDmsq ()
Double_t GetLikelihoodDifferenceForSinsq23 ()
void GetLnL (Double_t osc_dmsq, Double_t osc_sinsq23, Double_t osc_sinsq13, Double_t osc_deltaCP, Double_t beam_numu_norm, Double_t beam_numu_ncbkg, Double_t beam_numu_shwen, Double_t beam_numu_trken, Double_t beam_numu_trken_exit, Double_t beam_nue_norm, Double_t beam_nue_ncbkg, Double_t beam_numu_energy, Double_t atmos_norm_cv, Double_t atmos_norm_rock, Double_t atmos_chg_cv, Double_t atmos_chg_rock, Double_t atmos_nue_norm, Double_t atmos_nue_ratio, Double_t atmos_ncbkg, Double_t atmos_spec_cv_numu, Double_t atmos_spec_cv_numubar, Double_t atmos_spec_cv_nue, Double_t atmos_spec_cv_nuebar, Double_t atmos_spec_rock_nu, Double_t atmos_spec_rock_nubar, Double_t atmos_zenith, Double_t atmos_numu_trken, Double_t atmos_numu_trken_exit, Double_t atmos_numu_shwen, Double_t atmos_nue_energy, Double_t &LnL)
void GetLnL (Double_t input_dmsq, Double_t input_sinsq23, Double_t input_sinsq13, Double_t input_deltaCP, Double_t &osc_dmsq, Double_t &osc_sinsq23, Double_t &osc_sinsq13, Double_t &osc_deltaCP, Double_t &beam_numu_norm, Double_t &beam_numu_ncbkg, Double_t &beam_numu_shwen, Double_t &beam_numu_trken, Double_t &beam_numu_trken_exit, Double_t &beam_nue_norm, Double_t &beam_nue_ncbkg, Double_t &beam_nue_energy, Double_t &atmos_norm_cv, Double_t &atmos_norm_rock, Double_t &atmos_chg_cv, Double_t &atmos_chg_rock, Double_t &atmos_nue_norm, Double_t &atmos_nue_ratio, Double_t &atmos_ncbkg, Double_t &atmos_spec_cv_numu, Double_t &atmos_spec_cv_numubar, Double_t &atmos_spec_cv_nue, Double_t &atmos_spec_cv_nuebar, Double_t &atmos_spec_rock_nu, Double_t &atmos_spec_rock_nubar, Double_t &atmos_zenith, Double_t &atmos_numu_trken, Double_t &atmos_numu_trken_exit, Double_t &atmos_numu_shwen, Double_t &atmos_nue_energy, Double_t &LnL)
void RunFit (Double_t input_dmsq, Double_t input_sinsq23, Double_t input_sinsq13, Double_t input_deltaCP, Double_t &osc_dmsq, Double_t &osc_sinsq23, Double_t &osc_sinsq13, Double_t &osc_deltaCP, Double_t &beam_numu_norm, Double_t &beam_numu_ncbkg, Double_t &beam_numu_shwen, Double_t &beam_numu_trken, Double_t &beam_numu_trken_exit, Double_t &beam_nue_norm, Double_t &beam_nue_ncbkg, Double_t &beam_nue_energy, Double_t &atmos_norm_cv, Double_t &atmos_norm_rock, Double_t &atmos_chg_cv, Double_t &atmos_chg_rock, Double_t &atmos_nue_norm, Double_t &atmos_nue_ratio, Double_t &atmos_ncbkg, Double_t &atmos_spec_cv_numu, Double_t &atmos_spec_cv_numubar, Double_t &atmos_spec_cv_nue, Double_t &atmos_spec_cv_nuebar, Double_t &atmos_spec_rock_nu, Double_t &atmos_spec_rock_nubar, Double_t &atmos_zenith, Double_t &atmos_numu_trken, Double_t &atmos_numu_trken_exit, Double_t &atmos_numu_shwen, Double_t &atmos_nue_energy, Double_t &LnL)
void CalcProfileCPV (Bool_t isSensitivity=1, Bool_t isNormal=1, Int_t ifirst=-1, Int_t ilast=-1)
void CalcProfileDeltaCP (Bool_t isSensitivity=1, Bool_t isNormal=1, Int_t ifirst=-1, Int_t ilast=-1)
void CalcProfileSinsq23 (Bool_t isSensitivity=1, Bool_t isNormal=1, Int_t ifirst=-1, Int_t ilast=-1)
void RunOscFit (Bool_t isNormal=1, Int_t ifirst=-1, Int_t ilast=-1, Int_t jfirst=-1, Int_t jlast=-1)
void RunPseudoExpts (Int_t numExpts)
void RunFit ()
void RunTemplates ()
void RunTest ()
void Reset ()
void itr ()
void reset_counter ()
Int_t get_counter ()

Static Public Member Functions

static ThreeFlavourFitterInstance ()

Public Attributes

Double_t fOscDmsq
Double_t fOscSinsq23
Double_t fOscSinsq13
Double_t fOscDeltaCP
Double_t fBeamNumuNorm
Double_t fBeamNumuNCBkg
Double_t fBeamNumuShwEn
Double_t fBeamNumuTrkEn
Double_t fBeamNumuTrkEnExit
Double_t fBeamNueNorm
Double_t fBeamNueNCBkg
Double_t fBeamNueEnergy
Double_t fAtmosNormCV
Double_t fAtmosNormRock
Double_t fAtmosChgCV
Double_t fAtmosChgRock
Double_t fAtmosNueNorm
Double_t fAtmosNueRatio
Double_t fAtmosNCBkg
Double_t fAtmosSpecNumuCV
Double_t fAtmosSpecNumuBarCV
Double_t fAtmosSpecNueCV
Double_t fAtmosSpecNueBarCV
Double_t fAtmosSpecNuRock
Double_t fAtmosSpecNuBarRock
Double_t fAtmosZenith
Double_t fAtmosNumuTrkEn
Double_t fAtmosNumuTrkEnExit
Double_t fAtmosNumuShwEn
Double_t fAtmosNueEnergy
Double_t fOutputLnL
Bool_t fFittingDmsq
Bool_t fFittingSinsq23
Bool_t fFittingSinsq13
Bool_t fFittingDeltaCP
Bool_t fFittingBeamNumuNorm
Bool_t fFittingBeamNumuNCBkg
Bool_t fFittingBeamNumuShwEn
Bool_t fFittingBeamNumuTrkEn
Bool_t fFittingBeamNumuTrkEnExit
Bool_t fFittingBeamNueNorm
Bool_t fFittingBeamNueNCBkg
Bool_t fFittingBeamNueEnergy
Bool_t fFittingAtmosNormCV
Bool_t fFittingAtmosNormRock
Bool_t fFittingAtmosChgCV
Bool_t fFittingAtmosChgRock
Bool_t fFittingAtmosNueNorm
Bool_t fFittingAtmosNueRatio
Bool_t fFittingAtmosNCBkg
Bool_t fFittingAtmosSpecNumuCV
Bool_t fFittingAtmosSpecNumuBarCV
Bool_t fFittingAtmosSpecNueCV
Bool_t fFittingAtmosSpecNueBarCV
Bool_t fFittingAtmosSpecNuRock
Bool_t fFittingAtmosSpecNuBarRock
Bool_t fFittingAtmosZenith
Bool_t fFittingAtmosNumuTrkEn
Bool_t fFittingAtmosNumuTrkEnExit
Bool_t fFittingAtmosNumuShwEn
Bool_t fFittingAtmosNueEnergy
Int_t fCtr

Private Member Functions

 ThreeFlavourFitter ()
virtual ~ThreeFlavourFitter ()
void RunFitWithMinuit (Double_t input_dmsq, Double_t input_sinsq23, Double_t input_sinsq13, Double_t input_deltaCP)
void RunFitWithMinuit ()
void RunFitWithMinuitInSteps ()
Bool_t UsingBeamData ()
Bool_t UsingAtmosData ()

Private Attributes

TMinuit * fMinuit
Int_t fMinuitStatus
Double_t fLnL68
Double_t fLnL90
Double_t fLnL99
Double_t fLnL90_1D
TemplatefTemplateExpt
TemplatefTemplateMC
Double_t fInputDmsq
Double_t fInputSinsq23
Double_t fInputSinsq13
Double_t fInputDeltaCP
Double_t fInputBeamNumuNorm
Double_t fInputBeamNumuNCBkg
Double_t fInputBeamNumuShwEn
Double_t fInputBeamNumuTrkEn
Double_t fInputBeamNumuTrkEnExit
Double_t fInputBeamNueNorm
Double_t fInputBeamNueNCBkg
Double_t fInputBeamNueEnergy
Double_t fInputAtmosNormCV
Double_t fInputAtmosNormRock
Double_t fInputAtmosChgCV
Double_t fInputAtmosChgRock
Double_t fInputAtmosNueNorm
Double_t fInputAtmosNueRatio
Double_t fInputAtmosNCBkg
Double_t fInputAtmosSpecNumuCV
Double_t fInputAtmosSpecNumuBarCV
Double_t fInputAtmosSpecNueCV
Double_t fInputAtmosSpecNueBarCV
Double_t fInputAtmosSpecNuRock
Double_t fInputAtmosSpecNuBarRock
Double_t fInputAtmosZenith
Double_t fInputAtmosNumuTrkEn
Double_t fInputAtmosNumuTrkEnExit
Double_t fInputAtmosNumuShwEn
Double_t fInputAtmosNueEnergy
Double_t fSeedDmsq
Double_t fSeedSinsq23
Double_t fSeedSinsq13
Double_t fSeedDeltaCP
Double_t fSeedBeamNumuNorm
Double_t fSeedBeamNumuNCBkg
Double_t fSeedBeamNumuShwEn
Double_t fSeedBeamNumuTrkEn
Double_t fSeedBeamNumuTrkEnExit
Double_t fSeedBeamNueNorm
Double_t fSeedBeamNueNCBkg
Double_t fSeedBeamNueEnergy
Double_t fSeedAtmosNormCV
Double_t fSeedAtmosNormRock
Double_t fSeedAtmosChgCV
Double_t fSeedAtmosChgRock
Double_t fSeedAtmosNueNorm
Double_t fSeedAtmosNueRatio
Double_t fSeedAtmosNCBkg
Double_t fSeedAtmosSpecNumuCV
Double_t fSeedAtmosSpecNumuBarCV
Double_t fSeedAtmosSpecNueCV
Double_t fSeedAtmosSpecNueBarCV
Double_t fSeedAtmosSpecNuRock
Double_t fSeedAtmosSpecNuBarRock
Double_t fSeedAtmosZenith
Double_t fSeedAtmosNumuTrkEn
Double_t fSeedAtmosNumuTrkEnExit
Double_t fSeedAtmosNumuShwEn
Double_t fSeedAtmosNueEnergy
Double_t fBestFitOscDmsq
Double_t fBestFitOscSinsq23
Double_t fBestFitOscSinsq13
Double_t fBestFitOscDeltaCP
Double_t fBestFitBeamNumuNorm
Double_t fBestFitBeamNumuNCBkg
Double_t fBestFitBeamNumuShwEn
Double_t fBestFitBeamNumuTrkEn
Double_t fBestFitBeamNumuTrkEnExit
Double_t fBestFitBeamNueNorm
Double_t fBestFitBeamNueNCBkg
Double_t fBestFitBeamNueEnergy
Double_t fBestFitAtmosNormCV
Double_t fBestFitAtmosNormRock
Double_t fBestFitAtmosChgCV
Double_t fBestFitAtmosChgRock
Double_t fBestFitAtmosNueNorm
Double_t fBestFitAtmosNueRatio
Double_t fBestFitAtmosNCBkg
Double_t fBestFitAtmosSpecNumuCV
Double_t fBestFitAtmosSpecNumuBarCV
Double_t fBestFitAtmosSpecNueCV
Double_t fBestFitAtmosSpecNueBarCV
Double_t fBestFitAtmosSpecNuRock
Double_t fBestFitAtmosSpecNuBarRock
Double_t fBestFitAtmosZenith
Double_t fBestFitAtmosNumuTrkEn
Double_t fBestFitAtmosNumuTrkEnExit
Double_t fBestFitAtmosNumuShwEn
Double_t fBestFitAtmosNueEnergy
Double_t fBestFitLnL
Bool_t fFitDmsq
Bool_t fFitSinsq23
Bool_t fFitSinsq13
Bool_t fFitDeltaCP
Bool_t fFitBeamNumuNorm
Bool_t fFitBeamNumuNCBkg
Bool_t fFitBeamNumuShwEn
Bool_t fFitBeamNumuTrkEn
Bool_t fFitBeamNumuTrkEnExit
Bool_t fFitBeamNueNorm
Bool_t fFitBeamNueNCBkg
Bool_t fFitBeamNueEnergy
Bool_t fFitAtmosNormCV
Bool_t fFitAtmosNormRock
Bool_t fFitAtmosChgCV
Bool_t fFitAtmosChgRock
Bool_t fFitAtmosNueNorm
Bool_t fFitAtmosNueRatio
Bool_t fFitAtmosNCBkg
Bool_t fFitAtmosSpecNumuCV
Bool_t fFitAtmosSpecNumuBarCV
Bool_t fFitAtmosSpecNueCV
Bool_t fFitAtmosSpecNueBarCV
Bool_t fFitAtmosSpecNuRock
Bool_t fFitAtmosSpecNuBarRock
Bool_t fFitAtmosZenith
Bool_t fFitAtmosNumuTrkEn
Bool_t fFitAtmosNumuTrkEnExit
Bool_t fFitAtmosNumuShwEn
Bool_t fFitAtmosNueEnergy
Bool_t fMaskDmsq
Bool_t fMaskSinsq23
Bool_t fMaskSinsq13
Bool_t fMaskDeltaCP
Bool_t fMaskBeamNumuNorm
Bool_t fMaskBeamNumuNCBkg
Bool_t fMaskBeamNumuShwEn
Bool_t fMaskBeamNumuTrkEn
Bool_t fMaskBeamNumuTrkEnExit
Bool_t fMaskBeamNueNorm
Bool_t fMaskBeamNueNCBkg
Bool_t fMaskBeamNueEnergy
Bool_t fMaskAtmosNormCV
Bool_t fMaskAtmosNormRock
Bool_t fMaskAtmosChgCV
Bool_t fMaskAtmosChgRock
Bool_t fMaskAtmosNueNorm
Bool_t fMaskAtmosNueRatio
Bool_t fMaskAtmosNCBkg
Bool_t fMaskAtmosSpecNumuCV
Bool_t fMaskAtmosSpecNumuBarCV
Bool_t fMaskAtmosSpecNueCV
Bool_t fMaskAtmosSpecNueBarCV
Bool_t fMaskAtmosSpecNuRock
Bool_t fMaskAtmosSpecNuBarRock
Bool_t fMaskAtmosZenith
Bool_t fMaskAtmosNumuTrkEn
Bool_t fMaskAtmosNumuTrkEnExit
Bool_t fMaskAtmosNumuShwEn
Bool_t fMaskAtmosNueEnergy
Bool_t fFitHierarchy
Bool_t fFixOctant
Bool_t fSplitSinsq23
Bool_t fSplitDeltaCP
Bool_t fSplittingSinsq23
Bool_t fSplittingDeltaCP
Bool_t fSpecialSplitSinsq23
Bool_t fPenaltyTerms
Bool_t fDmsqBoundary
Bool_t fSinsq23Boundary
Bool_t fSinsq13Boundary
Bool_t fDeltaCPBoundary
Bool_t fUseSimplex
Bool_t fMockData
Bool_t fMockDataWithFluctuations
Bool_t fCorrelatedSystematics
Bool_t fDebug
Int_t fDmsqBins
Double_t fDmsqMin
Double_t fDmsqMax
Int_t fSinsq23Bins
Double_t fSinsq23Min
Double_t fSinsq23Max
Int_t fSinsq13Bins
Double_t fSinsq13Min
Double_t fSinsq13Max
Int_t fDeltaCPBins
Double_t fDeltaCPMin
Double_t fDeltaCPMax
Bool_t fExternalData
Bool_t fExternalConstraints
Double_t fExternalSinsq13
Double_t fExternalSinsq13Error
Double_t fEpsilon
Double_t fZeta
Double_t fBigNumber
Bool_t fWriteTemplates
TString fOutFile

Detailed Description

Definition at line 13 of file ThreeFlavourFitter.h.


Constructor & Destructor Documentation

ThreeFlavourFitter::ThreeFlavourFitter (  )  [private]

Definition at line 146 of file ThreeFlavourFitter.cxx.

References fBestFitAtmosChgCV, fBestFitAtmosChgRock, fBestFitAtmosNCBkg, fBestFitAtmosNormCV, fBestFitAtmosNormRock, fBestFitAtmosNueEnergy, fBestFitAtmosNueNorm, fBestFitAtmosNueRatio, fBestFitAtmosNumuShwEn, fBestFitAtmosNumuTrkEn, fBestFitAtmosNumuTrkEnExit, fBestFitAtmosSpecNuBarRock, fBestFitAtmosSpecNueBarCV, fBestFitAtmosSpecNueCV, fBestFitAtmosSpecNumuBarCV, fBestFitAtmosSpecNumuCV, fBestFitAtmosSpecNuRock, fBestFitAtmosZenith, fBestFitBeamNueEnergy, fBestFitBeamNueNCBkg, fBestFitBeamNueNorm, fBestFitBeamNumuNCBkg, fBestFitBeamNumuNorm, fBestFitBeamNumuShwEn, fBestFitBeamNumuTrkEn, fBestFitBeamNumuTrkEnExit, fBestFitLnL, fBestFitOscDeltaCP, fBestFitOscDmsq, fBestFitOscSinsq13, fBestFitOscSinsq23, fBigNumber, fCorrelatedSystematics, fCtr, fDebug, fDeltaCPBins, fDeltaCPBoundary, fDeltaCPMax, fDeltaCPMin, fDmsqBins, fDmsqBoundary, fDmsqMax, fDmsqMin, fEpsilon, fExternalConstraints, fExternalData, fExternalSinsq13, fExternalSinsq13Error, fFitAtmosChgCV, fFitAtmosChgRock, fFitAtmosNCBkg, fFitAtmosNormCV, fFitAtmosNormRock, fFitAtmosNueEnergy, fFitAtmosNueNorm, fFitAtmosNueRatio, fFitAtmosNumuShwEn, fFitAtmosNumuTrkEn, fFitAtmosNumuTrkEnExit, fFitAtmosSpecNuBarRock, fFitAtmosSpecNueBarCV, fFitAtmosSpecNueCV, fFitAtmosSpecNumuBarCV, fFitAtmosSpecNumuCV, fFitAtmosSpecNuRock, fFitAtmosZenith, fFitBeamNueEnergy, fFitBeamNueNCBkg, fFitBeamNueNorm, fFitBeamNumuNCBkg, fFitBeamNumuNorm, fFitBeamNumuShwEn, fFitBeamNumuTrkEn, fFitBeamNumuTrkEnExit, fFitDeltaCP, fFitDmsq, fFitHierarchy, fFitSinsq13, fFitSinsq23, fFittingAtmosChgCV, fFittingAtmosChgRock, fFittingAtmosNCBkg, fFittingAtmosNormCV, fFittingAtmosNormRock, fFittingAtmosNueEnergy, fFittingAtmosNueNorm, fFittingAtmosNueRatio, fFittingAtmosNumuShwEn, fFittingAtmosNumuTrkEn, fFittingAtmosNumuTrkEnExit, fFittingAtmosSpecNuBarRock, fFittingAtmosSpecNueBarCV, fFittingAtmosSpecNueCV, fFittingAtmosSpecNumuBarCV, fFittingAtmosSpecNumuCV, fFittingAtmosSpecNuRock, fFittingAtmosZenith, fFittingBeamNueEnergy, fFittingBeamNueNCBkg, fFittingBeamNueNorm, fFittingBeamNumuNCBkg, fFittingBeamNumuNorm, fFittingBeamNumuShwEn, fFittingBeamNumuTrkEn, fFittingBeamNumuTrkEnExit, fFittingDeltaCP, fFittingDmsq, fFittingSinsq13, fFittingSinsq23, fFixOctant, fInputAtmosChgCV, fInputAtmosChgRock, fInputAtmosNCBkg, fInputAtmosNormCV, fInputAtmosNormRock, fInputAtmosNueEnergy, fInputAtmosNueNorm, fInputAtmosNueRatio, fInputAtmosNumuShwEn, fInputAtmosNumuTrkEn, fInputAtmosNumuTrkEnExit, fInputAtmosSpecNuBarRock, fInputAtmosSpecNueBarCV, fInputAtmosSpecNueCV, fInputAtmosSpecNumuBarCV, fInputAtmosSpecNumuCV, fInputAtmosSpecNuRock, fInputAtmosZenith, fInputBeamNueEnergy, fInputBeamNueNCBkg, fInputBeamNueNorm, fInputBeamNumuNCBkg, fInputBeamNumuNorm, fInputBeamNumuShwEn, fInputBeamNumuTrkEn, fInputBeamNumuTrkEnExit, fInputDeltaCP, fInputDmsq, fInputSinsq13, fInputSinsq23, fLnL68, fLnL90, fLnL90_1D, fLnL99, fMaskAtmosChgCV, fMaskAtmosChgRock, fMaskAtmosNCBkg, fMaskAtmosNormCV, fMaskAtmosNormRock, fMaskAtmosNueEnergy, fMaskAtmosNueNorm, fMaskAtmosNueRatio, fMaskAtmosNumuShwEn, fMaskAtmosNumuTrkEn, fMaskAtmosNumuTrkEnExit, fMaskAtmosSpecNuBarRock, fMaskAtmosSpecNueBarCV, fMaskAtmosSpecNueCV, fMaskAtmosSpecNumuBarCV, fMaskAtmosSpecNumuCV, fMaskAtmosSpecNuRock, fMaskAtmosZenith, fMaskBeamNueEnergy, fMaskBeamNueNCBkg, fMaskBeamNueNorm, fMaskBeamNumuNCBkg, fMaskBeamNumuNorm, fMaskBeamNumuShwEn, fMaskBeamNumuTrkEn, fMaskBeamNumuTrkEnExit, fMaskDeltaCP, fMaskDmsq, fMaskSinsq13, fMaskSinsq23, fMinuit, fMinuitStatus, fMockData, fMockDataWithFluctuations, fOutFile, fPenaltyTerms, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, fSinsq13Bins, fSinsq13Boundary, fSinsq13Max, fSinsq13Min, fSinsq23Bins, fSinsq23Boundary, fSinsq23Max, fSinsq23Min, fSpecialSplitSinsq23, fSplitDeltaCP, fSplitSinsq23, fSplittingDeltaCP, fSplittingSinsq23, fTemplateExpt, fTemplateMC, fUseSimplex, fWriteTemplates, fZeta, and OscFit::Sinsq13().

Referenced by Instance().

00147 {
00148   std::cout << " *** Starting Three Flavour Fitter *** " << std::endl;
00149 
00150   fLnL68 = 1.15;     // 68.27: d(Chi2) = 2.296 -> 1.15
00151   fLnL90 = 2.30;     // 90.0:  d(Chi2) = 4.605 -> 2.30
00152   fLnL99 = 4.61;     // 99.0:  d(Chi2) = 9.211 -> 4.61
00153 
00154   fLnL90_1D = 1.35;  // 90.0:  d(Chi2) = 2.706 -> 1.35
00155 
00156   fInputDmsq               = 2.40e-3;
00157   fInputSinsq23            = 0.45;
00158   fInputSinsq13            = OscFit::Sinsq13();
00159   fInputDeltaCP            = TMath::Pi();
00160   fInputBeamNumuNorm       = 0.0;
00161   fInputBeamNumuNCBkg      = 0.0;
00162   fInputBeamNumuShwEn      = 0.0;
00163   fInputBeamNumuTrkEn      = 0.0;
00164   fInputBeamNumuTrkEnExit  = 0.0;
00165   fInputBeamNueNorm        = 0.0;
00166   fInputBeamNueNCBkg       = 0.0;
00167   fInputBeamNueEnergy      = 0.0;
00168   fInputAtmosNormCV        = 0.0;
00169   fInputAtmosNormRock      = 0.0;
00170   fInputAtmosChgCV         = 0.0;
00171   fInputAtmosChgRock       = 0.0;
00172   fInputAtmosNueNorm       = 0.0;
00173   fInputAtmosNueRatio      = 0.0;
00174   fInputAtmosNCBkg         = 0.0;
00175   fInputAtmosSpecNumuCV    = 0.0;
00176   fInputAtmosSpecNumuBarCV = 0.0;
00177   fInputAtmosSpecNueCV     = 0.0;
00178   fInputAtmosSpecNueBarCV  = 0.0;
00179   fInputAtmosSpecNuRock    = 0.0;
00180   fInputAtmosSpecNuBarRock = 0.0;
00181   fInputAtmosZenith        = 0.0;
00182   fInputAtmosNumuTrkEn     = 0.0;
00183   fInputAtmosNumuTrkEnExit = 0.0;
00184   fInputAtmosNumuShwEn     = 0.0;
00185   fInputAtmosNueEnergy     = 0.0;
00186 
00187   fSeedDmsq                = 2.4e-3;
00188   fSeedSinsq23             = 0.5;
00189   fSeedSinsq13             = OscFit::Sinsq13();
00190   fSeedDeltaCP             = TMath::Pi();
00191   fSeedBeamNumuNorm        = 0.0;
00192   fSeedBeamNumuNCBkg       = 0.0;
00193   fSeedBeamNumuShwEn       = 0.0;
00194   fSeedBeamNumuTrkEn       = 0.0;  
00195   fSeedBeamNumuTrkEnExit   = 0.0;  
00196   fSeedBeamNueNorm         = 0.0;
00197   fSeedBeamNueNCBkg        = 0.0;
00198   fSeedBeamNueEnergy       = 0.0;
00199   fSeedAtmosNormCV         = 0.0;
00200   fSeedAtmosNormRock       = 0.0;
00201   fSeedAtmosChgCV          = 0.0;
00202   fSeedAtmosChgRock        = 0.0;
00203   fSeedAtmosNueNorm        = 0.0;
00204   fSeedAtmosNueRatio       = 0.0;
00205   fSeedAtmosNCBkg          = 0.0;
00206   fSeedAtmosSpecNumuCV     = 0.0;
00207   fSeedAtmosSpecNumuBarCV  = 0.0;
00208   fSeedAtmosSpecNueCV      = 0.0;
00209   fSeedAtmosSpecNueBarCV   = 0.0;
00210   fSeedAtmosSpecNuRock     = 0.0;
00211   fSeedAtmosSpecNuBarRock  = 0.0;
00212   fSeedAtmosZenith         = 0.0;
00213   fSeedAtmosNumuTrkEn      = 0.0;
00214   fSeedAtmosNumuTrkEnExit  = 0.0;
00215   fSeedAtmosNumuShwEn      = 0.0;
00216   fSeedAtmosNueEnergy      = 0.0;
00217 
00218   fBestFitOscDmsq            = 0.0;
00219   fBestFitOscSinsq23         = 0.0;
00220   fBestFitOscSinsq13         = 0.0;
00221   fBestFitOscDeltaCP         = 0.0;
00222   fBestFitBeamNumuNorm       = 0.0;
00223   fBestFitBeamNumuNCBkg      = 0.0;
00224   fBestFitBeamNumuShwEn      = 0.0;
00225   fBestFitBeamNumuTrkEn      = 0.0;
00226   fBestFitBeamNumuTrkEnExit  = 0.0;
00227   fBestFitBeamNueNorm        = 0.0;
00228   fBestFitBeamNueNCBkg       = 0.0;
00229   fBestFitBeamNueEnergy      = 0.0;
00230   fBestFitAtmosNormCV        = 0.0;
00231   fBestFitAtmosNormRock      = 0.0;
00232   fBestFitAtmosChgCV         = 0.0;
00233   fBestFitAtmosChgRock       = 0.0;
00234   fBestFitAtmosNueNorm       = 0.0;
00235   fBestFitAtmosNueRatio      = 0.0;
00236   fBestFitAtmosNCBkg         = 0.0;
00237   fBestFitAtmosSpecNumuCV    = 0.0;
00238   fBestFitAtmosSpecNumuBarCV = 0.0;
00239   fBestFitAtmosSpecNueCV     = 0.0;
00240   fBestFitAtmosSpecNueBarCV  = 0.0;
00241   fBestFitAtmosSpecNuRock    = 0.0;
00242   fBestFitAtmosSpecNuBarRock = 0.0;
00243   fBestFitAtmosZenith        = 0.0;
00244   fBestFitAtmosNumuTrkEn     = 0.0;
00245   fBestFitAtmosNumuTrkEnExit = 0.0;
00246   fBestFitAtmosNumuShwEn     = 0.0;
00247   fBestFitAtmosNueEnergy     = 0.0;
00248   fBestFitLnL                = 0.0;
00249 
00250   fFitDmsq                   = 0;
00251   fFitSinsq23                = 0;
00252   fFitSinsq13                = 0;
00253   fFitDeltaCP                = 0;
00254   fFitBeamNumuNorm           = 0;
00255   fFitBeamNumuNCBkg          = 0;
00256   fFitBeamNumuShwEn          = 0;
00257   fFitBeamNumuTrkEn          = 0;  
00258   fFitBeamNumuTrkEnExit      = 0;  
00259   fFitBeamNueNorm            = 0;
00260   fFitBeamNueNCBkg           = 0;
00261   fFitBeamNueEnergy          = 0;
00262   fFitAtmosNormCV            = 0;
00263   fFitAtmosNormRock          = 0;
00264   fFitAtmosChgCV             = 0;
00265   fFitAtmosChgRock           = 0;
00266   fFitAtmosNueNorm           = 0;
00267   fFitAtmosNueRatio          = 0;
00268   fFitAtmosNCBkg             = 0;
00269   fFitAtmosSpecNumuCV        = 0;
00270   fFitAtmosSpecNumuBarCV     = 0;
00271   fFitAtmosSpecNueCV         = 0;
00272   fFitAtmosSpecNueBarCV      = 0;
00273   fFitAtmosSpecNuRock        = 0;
00274   fFitAtmosSpecNuBarRock     = 0;
00275   fFitAtmosZenith            = 0;
00276   fFitAtmosNumuTrkEn         = 0;
00277   fFitAtmosNumuTrkEnExit     = 0;
00278   fFitAtmosNumuShwEn         = 0;
00279   fFitAtmosNueEnergy         = 0;
00280   
00281   fMaskDmsq                = 1;
00282   fMaskSinsq23             = 1;
00283   fMaskSinsq13             = 1;
00284   fMaskDeltaCP             = 1;
00285   fMaskBeamNumuNorm        = 1;
00286   fMaskBeamNumuNCBkg       = 1;
00287   fMaskBeamNumuShwEn       = 1;
00288   fMaskBeamNumuTrkEn       = 1; 
00289   fMaskBeamNumuTrkEnExit   = 1; 
00290   fMaskBeamNueNorm         = 1;
00291   fMaskBeamNueNCBkg        = 1;
00292   fMaskBeamNueEnergy       = 1;
00293   fMaskAtmosNormCV         = 1;
00294   fMaskAtmosNormRock       = 1;
00295   fMaskAtmosChgCV          = 1;
00296   fMaskAtmosChgRock        = 1;
00297   fMaskAtmosNueNorm        = 1;
00298   fMaskAtmosNueRatio       = 1;
00299   fMaskAtmosNCBkg          = 1;
00300   fMaskAtmosSpecNumuCV     = 1;
00301   fMaskAtmosSpecNumuBarCV  = 1;
00302   fMaskAtmosSpecNueCV      = 1;
00303   fMaskAtmosSpecNueBarCV   = 1;
00304   fMaskAtmosSpecNuRock     = 1;
00305   fMaskAtmosSpecNuBarRock  = 1;
00306   fMaskAtmosZenith         = 1;
00307   fMaskAtmosNumuTrkEn      = 1;
00308   fMaskAtmosNumuTrkEnExit  = 1;
00309   fMaskAtmosNumuShwEn      = 1;
00310   fMaskAtmosNueEnergy      = 1;
00311 
00312   fFittingDmsq               = 0;
00313   fFittingSinsq23            = 0;
00314   fFittingSinsq13            = 0;
00315   fFittingDeltaCP            = 0;
00316   fFittingBeamNumuNorm       = 0;
00317   fFittingBeamNumuNCBkg      = 0;
00318   fFittingBeamNumuShwEn      = 0;
00319   fFittingBeamNumuTrkEn      = 0;  
00320   fFittingBeamNumuTrkEnExit  = 0;  
00321   fFittingBeamNueNorm        = 0;
00322   fFittingBeamNueNCBkg       = 0;
00323   fFittingBeamNueEnergy      = 0;
00324   fFittingAtmosNormCV        = 0;
00325   fFittingAtmosNormRock      = 0;
00326   fFittingAtmosChgCV         = 0;
00327   fFittingAtmosChgRock       = 0;
00328   fFittingAtmosNueNorm       = 0;
00329   fFittingAtmosNueRatio      = 0;
00330   fFittingAtmosNCBkg         = 0;
00331   fFittingAtmosSpecNumuCV    = 0;
00332   fFittingAtmosSpecNumuBarCV = 0;
00333   fFittingAtmosSpecNueCV     = 0;
00334   fFittingAtmosSpecNueBarCV  = 0;
00335   fFittingAtmosSpecNuRock    = 0;
00336   fFittingAtmosSpecNuBarRock = 0;
00337   fFittingAtmosZenith        = 0;
00338   fFittingAtmosNumuTrkEn     = 0;
00339   fFittingAtmosNumuTrkEnExit = 0;
00340   fFittingAtmosNumuShwEn     = 0; 
00341   fFittingAtmosNueEnergy     = 0; 
00342   
00343 
00344   fMockData = 1;  // By default, calculate sensitivities 
00345   fMockDataWithFluctuations = 0; 
00346 
00347   fCorrelatedSystematics = 0;
00348 
00349   fUseSimplex   = 0;
00350   fFitHierarchy = 0;
00351   fFixOctant    = 0;
00352 
00353   fSplitSinsq23     = 1; // By default, handle octant degeneracy
00354   fSplitDeltaCP     = 1; // By default, handle delta degeneracy
00355 
00356   fSplittingSinsq23 = 0;
00357   fSplittingDeltaCP = 0;
00358 
00359   fSpecialSplitSinsq23 = 0;
00360 
00361   fPenaltyTerms    = 1;
00362   fDmsqBoundary    = 0;
00363   fSinsq23Boundary = 0;
00364   fSinsq13Boundary = 0;
00365   fDeltaCPBoundary = 0;
00366 
00367   fTemplateMC   = new Template();
00368   fTemplateExpt = new Template();
00369 
00370   fWriteTemplates = 0;
00371 
00372   fOutFile = "oscfit.root";
00373 
00374   gRandom->SetSeed(0);
00375 
00376   fMinuit = new TMinuit();
00377   fMinuit->SetPrintLevel(-1);
00378   fMinuit->SetMaxIterations(5000);
00379 
00380   fMinuitStatus = 999;
00381 
00382   fDmsqBins = 0;
00383   fDmsqMin  = 0.0;
00384   fDmsqMax  = 0.0;
00385 
00386   fSinsq23Bins = 0;
00387   fSinsq23Min  = 0.0;
00388   fSinsq23Max  = 0.0;
00389 
00390   fSinsq13Bins = 0;
00391   fSinsq13Min  = 0.0;
00392   fSinsq13Max  = 0.0;
00393 
00394   fDeltaCPBins = 0;
00395   fDeltaCPMin  = 0.0;
00396   fDeltaCPMax  = 0.0;
00397 
00398   fExternalData = false;
00399 
00400   fExternalConstraints  = false; 
00401   fExternalSinsq13      = OscFit::Sinsq13(); 
00402   fExternalSinsq13Error = 0.0025; // from Reactor Experiments
00403 
00404   fEpsilon = 0.0005;
00405   fZeta    = 0.025;
00406 
00407   fBigNumber = 1.0e10;
00408 
00409   fDebug = 1;
00410   fCtr = 0;
00411 }

ThreeFlavourFitter::~ThreeFlavourFitter (  )  [private, virtual]

Definition at line 413 of file ThreeFlavourFitter.cxx.

References fMinuit, fTemplateExpt, and fTemplateMC.

00414 {
00415   delete fMinuit;
00416 
00417   delete fTemplateMC;
00418   delete fTemplateExpt;
00419 }


Member Function Documentation

void OscFit::ThreeFlavourFitter::AddPenaltyTerms ( Bool_t  yesno = 1  )  [inline]

Definition at line 95 of file ThreeFlavourFitter.h.

References fPenaltyTerms.

00095                                              {
00096       fPenaltyTerms = yesno;
00097     }

void ThreeFlavourFitter::ApplyExternalConstraintOnSinsq13 (  ) 

Definition at line 781 of file ThreeFlavourFitter.cxx.

References fExternalConstraints.

Referenced by FitSinsq13WithExternalConstraint().

00782 {
00783   fExternalConstraints = true;
00784 
00785   //
00786   // will use default central value and error
00787   //
00788 }

void ThreeFlavourFitter::BuildExpt (  ) 
void ThreeFlavourFitter::BuildExptFromData (  ) 

Definition at line 829 of file ThreeFlavourFitter.cxx.

References fMockData, fTemplateExpt, OscFit::TemplateReader::Instance(), Instance(), PrintExpt(), ResetExpt(), and TouchExpt().

Referenced by BuildExpt().

00830 {
00831   // sanity check  
00832   if( fMockData==1 ) return;
00833 
00834   std::cout << " *** ThreeFlavourFitter::BuildExptFromData() *** " << std::endl;
00835 
00836   // reset experiments
00837   this->ResetExpt();
00838 
00839   // bail out if there is no data
00840   if( TemplateReader::Instance()->TouchData()==0 ) {
00841     std::cout << "   <warning> The real data is not loaded " << std::endl;
00842     assert(0);
00843   }
00844 
00845   // build experiment
00846   TemplateCalculator::Instance()->GetData( fTemplateExpt );
00847 
00848   // print experiments
00849   this->PrintExpt();
00850 
00851   // check experiment
00852   assert( TouchExpt() );
00853 
00854   return;
00855 }

void ThreeFlavourFitter::BuildExptFromMC (  ) 

Definition at line 857 of file ThreeFlavourFitter.cxx.

References fCorrelatedSystematics, fInputAtmosChgCV, fInputAtmosChgRock, fInputAtmosNCBkg, fInputAtmosNormCV, fInputAtmosNormRock, fInputAtmosNueEnergy, fInputAtmosNueNorm, fInputAtmosNueRatio, fInputAtmosNumuShwEn, fInputAtmosNumuTrkEn, fInputAtmosNumuTrkEnExit, fInputAtmosSpecNuBarRock, fInputAtmosSpecNueBarCV, fInputAtmosSpecNueCV, fInputAtmosSpecNumuBarCV, fInputAtmosSpecNumuCV, fInputAtmosSpecNuRock, fInputAtmosZenith, fInputBeamNueEnergy, fInputBeamNueNCBkg, fInputBeamNueNorm, fInputBeamNumuNCBkg, fInputBeamNumuNorm, fInputBeamNumuShwEn, fInputBeamNumuTrkEn, fInputBeamNumuTrkEnExit, fInputDeltaCP, fInputDmsq, fInputSinsq13, fInputSinsq23, fMockData, fMockDataWithFluctuations, fTemplateExpt, OscFit::Configuration::GetExperiment(), OscFit::TemplateReader::Instance(), Instance(), OscFit::Configuration::Instance(), OscFit::kLBNE, OscFit::kMINOS, PrintExpt(), ResetExpt(), TouchExpt(), UsingAtmosData(), and UsingBeamData().

Referenced by BuildExpt().

00858 {
00859   // sanity check
00860   if( fMockData==0 ) return;
00861 
00862   std::cout << " *** ThreeFlavourFitter::BuildExptFromMC() *** " << std::endl;
00863 
00864   // Reset Experiments
00865   // =================
00866   this->ResetExpt();
00867 
00868   // bail out if there is no MC
00869   if( TemplateReader::Instance()->TouchMC()==0 ) {
00870     std::cout << "   <warning> The Monte Carlo is not loaded " << std::endl;
00871     assert(0);
00872   }
00873 
00874   // Input Parameters
00875   // ================
00876   Double_t inputDmsq               = fInputDmsq;
00877   Double_t inputSinsq23            = fInputSinsq23;
00878   Double_t inputSinsq13            = fInputSinsq13;
00879   Double_t inputDeltaCP            = fInputDeltaCP;
00880   Double_t inputBeamNumuNorm       = 0.0;
00881   Double_t inputBeamNumuNCBkg      = 0.0;
00882   Double_t inputBeamNumuShwEn      = 0.0;
00883   Double_t inputBeamNumuTrkEn      = 0.0;
00884   Double_t inputBeamNumuTrkEnExit  = 0.0;
00885   Double_t inputBeamNueNorm        = 0.0;
00886   Double_t inputBeamNueNCBkg       = 0.0;
00887   Double_t inputBeamNueEnergy      = 0.0;
00888   Double_t inputAtmosNormCV        = 0.0;
00889   Double_t inputAtmosNormRock      = 0.0;
00890   Double_t inputAtmosChgCV         = 0.0;
00891   Double_t inputAtmosChgRock       = 0.0;
00892   Double_t inputAtmosNueNorm       = 0.0;
00893   Double_t inputAtmosNueRatio      = 0.0;
00894   Double_t inputAtmosNCBkg         = 0.0;
00895   Double_t inputAtmosSpecNumuCV    = 0.0;
00896   Double_t inputAtmosSpecNumuBarCV = 0.0;
00897   Double_t inputAtmosSpecNueCV     = 0.0;
00898   Double_t inputAtmosSpecNueBarCV  = 0.0;
00899   Double_t inputAtmosSpecNuRock    = 0.0;
00900   Double_t inputAtmosSpecNuBarRock = 0.0;
00901   Double_t inputAtmosZenith        = 0.0;
00902   Double_t inputAtmosNumuTrkEn     = 0.0;
00903   Double_t inputAtmosNumuTrkEnExit = 0.0;
00904   Double_t inputAtmosNumuShwEn     = 0.0;
00905   Double_t inputAtmosNueEnergy     = 0.0;
00906   
00907 
00908   // Input Beam Systematics
00909   // ======================
00910   if( UsingBeamData() ){
00911 
00912     inputBeamNumuNorm      = fInputBeamNumuNorm;
00913     inputBeamNumuNCBkg     = fInputBeamNumuNCBkg;
00914     inputBeamNumuShwEn     = fInputBeamNumuShwEn;
00915     inputBeamNumuTrkEn     = fInputBeamNumuTrkEn;
00916     inputBeamNumuTrkEnExit = fInputBeamNumuTrkEnExit;
00917     inputBeamNueNorm       = fInputBeamNueNorm;
00918     inputBeamNueNCBkg      = fInputBeamNueNCBkg;
00919     inputBeamNueEnergy     = fInputBeamNueEnergy;
00920 
00921     // Pick Systematic Parameters
00922     if( fMockDataWithFluctuations ){
00923 
00924       Bool_t   flag = 0;
00925       Double_t deltaInputBeamNumuNorm      = 0.0;
00926       Double_t deltaInputBeamNumuNCBkg     = 0.0;
00927       Double_t deltaInputBeamNumuShwEn     = 0.0;
00928       Double_t deltaInputBeamNumuTrkEn     = 0.0;
00929       Double_t deltaInputBeamNumuTrkEnExit = 0.0;
00930       Double_t deltaInputBeamNueNorm       = 0.0;
00931       Double_t deltaInputBeamNueNCBkg      = 0.0;
00932       Double_t deltaInputBeamNueEnergy     = 0.0;
00933 
00934       // Beam Numu Normalisation        
00935       flag = 0;
00936       while( !(deltaInputBeamNumuNorm>-2.0 && deltaInputBeamNumuNorm<+2.0 && flag) ){
00937         deltaInputBeamNumuNorm = gRandom->Gaus(0.0,1.0); flag = 1;
00938       }
00939 
00940       // Beam Numu NC Background
00941       flag = 0;
00942       while( !(deltaInputBeamNumuNCBkg>-2.0 && deltaInputBeamNumuNCBkg<+2.0 && flag) ){
00943         deltaInputBeamNumuNCBkg = gRandom->Gaus(0.0,1.0); flag = 1;
00944       }
00945 
00946       // Beam Numu Shower Energy
00947       flag = 0;
00948       while( !(deltaInputBeamNumuShwEn>-2.0 && deltaInputBeamNumuShwEn<+2.0 && flag) ){
00949         deltaInputBeamNumuShwEn = gRandom->Gaus(0.0,1.0); flag = 1;
00950       }
00951 
00952       // Beam Numu Track Energy
00953       flag = 0;
00954       while( !(deltaInputBeamNumuTrkEn>-2.0 && deltaInputBeamNumuTrkEn<+2.0 && flag) ){
00955         deltaInputBeamNumuTrkEn = gRandom->Gaus(0.0,1.0); flag = 1;
00956       }  
00957 
00958       // Beam Numu Track Energy (Exiting)
00959       flag = 0;
00960       while( !(deltaInputBeamNumuTrkEnExit>-2.0 && deltaInputBeamNumuTrkEnExit<+2.0 && flag) ){
00961         deltaInputBeamNumuTrkEnExit = gRandom->Gaus(0.0,1.0); flag = 1;
00962       }  
00963 
00964       // Beam Nue Normalisation        
00965       flag = 0;
00966       while( !(deltaInputBeamNueNorm>-2.0 && deltaInputBeamNueNorm<+2.0 && flag) ){
00967         deltaInputBeamNueNorm = gRandom->Gaus(0.0,1.0); flag = 1;
00968       }
00969 
00970       // Beam Nue NC Background
00971       flag = 0;
00972       while( !(deltaInputBeamNueNCBkg>-2.0 && deltaInputBeamNueNCBkg<+2.0 && flag) ){
00973         deltaInputBeamNueNCBkg = gRandom->Gaus(0.0,1.0); flag = 1;
00974       }
00975 
00976       // Beam Nue Energy
00977       flag = 0;
00978       while( !(deltaInputBeamNueEnergy>-2.0 && deltaInputBeamNueEnergy<+2.0 && flag) ){
00979         deltaInputBeamNueEnergy = gRandom->Gaus(0.0,1.0); flag = 1;
00980       }
00981 
00982       // increment systematic parameters
00983       inputBeamNumuNorm      += deltaInputBeamNumuNorm;
00984       inputBeamNumuNCBkg     += deltaInputBeamNumuNCBkg;
00985       inputBeamNumuShwEn     += deltaInputBeamNumuShwEn;
00986       inputBeamNumuTrkEn     += deltaInputBeamNumuTrkEn;
00987       inputBeamNumuTrkEnExit += deltaInputBeamNumuTrkEnExit;
00988       inputBeamNueNorm       += deltaInputBeamNueNorm;
00989       inputBeamNueNCBkg      += deltaInputBeamNueNCBkg;
00990       inputBeamNueEnergy     += deltaInputBeamNueEnergy;
00991     }
00992   }
00993 
00994   // Input Atmos Systematics
00995   // =======================
00996   if( UsingAtmosData() ){
00997 
00998     inputAtmosNormCV        = fInputAtmosNormCV;
00999     inputAtmosNormRock      = fInputAtmosNormRock;
01000     inputAtmosChgCV         = fInputAtmosChgCV;
01001     inputAtmosChgRock       = fInputAtmosChgRock;
01002     inputAtmosNueNorm       = fInputAtmosNueNorm;
01003     inputAtmosNueRatio      = fInputAtmosNueRatio;
01004     inputAtmosNCBkg         = fInputAtmosNCBkg;
01005     inputAtmosSpecNumuCV    = fInputAtmosSpecNumuCV;
01006     inputAtmosSpecNumuBarCV = fInputAtmosSpecNumuBarCV;
01007     inputAtmosSpecNueCV     = fInputAtmosSpecNueCV;
01008     inputAtmosSpecNueBarCV  = fInputAtmosSpecNueBarCV;
01009     inputAtmosSpecNuRock    = fInputAtmosSpecNuRock;
01010     inputAtmosSpecNuBarRock = fInputAtmosSpecNuBarRock;
01011     inputAtmosZenith        = fInputAtmosZenith;
01012     inputAtmosNumuTrkEn     = fInputAtmosNumuTrkEn;
01013     inputAtmosNumuTrkEnExit = fInputAtmosNumuTrkEnExit;
01014     inputAtmosNumuShwEn     = fInputAtmosNumuShwEn;
01015     inputAtmosNueEnergy     = fInputAtmosNueEnergy;
01016 
01017     // Pick Systematic Parameters
01018     if( fMockDataWithFluctuations ){
01019 
01020       Bool_t   flag = 0;
01021       Double_t deltaInputAtmosNormCV        = 0.0;
01022       Double_t deltaInputAtmosNormRock      = 0.0;
01023       Double_t deltaInputAtmosChgCV         = 0.0;
01024       Double_t deltaInputAtmosChgRock       = 0.0;
01025       Double_t deltaInputAtmosNueNorm       = 0.0;
01026       Double_t deltaInputAtmosNueRatio      = 0.0;
01027       Double_t deltaInputAtmosNCBkg         = 0.0;
01028       Double_t deltaInputAtmosSpecNumuCV    = 0.0;
01029       Double_t deltaInputAtmosSpecNumuBarCV = 0.0;
01030       Double_t deltaInputAtmosSpecNueCV     = 0.0;
01031       Double_t deltaInputAtmosSpecNueBarCV  = 0.0;
01032       Double_t deltaInputAtmosSpecNuRock    = 0.0;
01033       Double_t deltaInputAtmosSpecNuBarRock = 0.0;
01034       Double_t deltaInputAtmosZenith        = 0.0;
01035       Double_t deltaInputAtmosNumuTrkEn     = 0.0;
01036       Double_t deltaInputAtmosNumuTrkEnExit = 0.0;
01037       Double_t deltaInputAtmosNumuShwEn     = 0.0;
01038       Double_t deltaInputAtmosNueEnergy     = 0.0;
01039 
01040       // Atmos Normalisation (CV)
01041       flag = 0;
01042       while( !(deltaInputAtmosNormCV>-2.0 && deltaInputAtmosNormCV<+2.0 && flag) ){
01043         deltaInputAtmosNormCV = gRandom->Gaus(0.0,1.0); flag = 1;
01044       }
01045 
01046       // Atmos Normalisation (Rock)
01047       flag = 0;
01048       while( !(deltaInputAtmosNormRock>-2.0 && deltaInputAtmosNormRock<+2.0 && flag) ){
01049         deltaInputAtmosNormRock = gRandom->Gaus(0.0,1.0); flag = 1;
01050       }
01051 
01052       // Atmos Charge Ratio (CV)
01053       flag = 0;
01054       while( !(deltaInputAtmosChgCV>-2.0 && deltaInputAtmosChgCV<+2.0 && flag) ){
01055         deltaInputAtmosChgCV = gRandom->Gaus(0.0,1.0); flag = 1;
01056       }
01057 
01058       // Atmos Charge Ratio (Rock)
01059       flag = 0;
01060       while( !(deltaInputAtmosChgRock>-2.0 && deltaInputAtmosChgRock<+2.0 && flag) ){
01061         deltaInputAtmosChgRock = gRandom->Gaus(0.0,1.0); flag = 1;
01062       }
01063 
01064       // Atmos Electron Neutrinos (Norm)
01065       flag = 0;
01066       while( !(deltaInputAtmosNueNorm>-2.0 && deltaInputAtmosNueNorm<+2.0 && flag) ){
01067         deltaInputAtmosNueNorm = gRandom->Gaus(0.0,1.0); flag = 1;
01068       }
01069  
01070       // Atmos Electron Neutrinos (Ratio)
01071       flag = 0;
01072       while( !(deltaInputAtmosNueRatio>-2.0 && deltaInputAtmosNueRatio<+2.0 && flag) ){
01073         deltaInputAtmosNueRatio = gRandom->Gaus(0.0,1.0); flag = 1;
01074       }
01075 
01076       // Atmos NC Background
01077       flag = 0;
01078       while( !(deltaInputAtmosNCBkg>-2.0 && deltaInputAtmosNCBkg<+2.0 && flag) ){
01079         deltaInputAtmosNCBkg = gRandom->Gaus(0.0,1.0); flag = 1;
01080       } 
01081 
01082       // Atmos CV Spectrum (Numu)
01083       flag = 0;
01084       while( !(deltaInputAtmosSpecNumuCV>-2.0 && deltaInputAtmosSpecNumuCV<+2.0 && flag) ){
01085         deltaInputAtmosSpecNumuCV = gRandom->Gaus(0.0,1.0); flag = 1;
01086       }
01087 
01088       // Atmos CV Spectrum (NumuBar)
01089       flag = 0;
01090       while( !(deltaInputAtmosSpecNumuBarCV>-2.0 && deltaInputAtmosSpecNumuBarCV<+2.0 && flag) ){
01091         deltaInputAtmosSpecNumuBarCV = gRandom->Gaus(0.0,1.0); flag = 1;
01092       }
01093 
01094       // Atmos CV Spectrum (Nue)
01095       flag = 0;
01096       while( !(deltaInputAtmosSpecNueCV>-2.0 && deltaInputAtmosSpecNueCV<+2.0 && flag) ){
01097         deltaInputAtmosSpecNueCV = gRandom->Gaus(0.0,1.0); flag = 1;
01098       }
01099 
01100       // Atmos CV Spectrum (NueBar)
01101       flag = 0;
01102       while( !(deltaInputAtmosSpecNueBarCV>-2.0 && deltaInputAtmosSpecNueBarCV<+2.0 && flag) ){
01103         deltaInputAtmosSpecNueBarCV = gRandom->Gaus(0.0,1.0); flag = 1;
01104       }
01105 
01106       // Atmos Rock Spectrum (Nu)
01107       flag = 0;
01108       while( !(deltaInputAtmosSpecNuRock>-2.0 && deltaInputAtmosSpecNuRock<+2.0 && flag) ){
01109         deltaInputAtmosSpecNuRock = gRandom->Gaus(0.0,1.0); flag = 1;
01110       }
01111 
01112       // Atmos Rock Spectrum (NuBar)
01113       flag = 0;
01114       while( !(deltaInputAtmosSpecNuBarRock>-2.0 && deltaInputAtmosSpecNuBarRock<+2.0 && flag) ){
01115         deltaInputAtmosSpecNuBarRock = gRandom->Gaus(0.0,1.0); flag = 1;
01116       }
01117 
01118       // Atmos Zenith Angle
01119       flag = 0;
01120       while( !(deltaInputAtmosZenith>-2.0 && deltaInputAtmosZenith<+2.0 && flag) ){
01121         deltaInputAtmosZenith = gRandom->Gaus(0.0,1.0); flag = 1;
01122       }
01123 
01124       // Atmos Track Energy (Stopping)
01125       flag = 0;
01126       while( !(deltaInputAtmosNumuTrkEn>-2.0 && deltaInputAtmosNumuTrkEn<+2.0 && flag) ){
01127         deltaInputAtmosNumuTrkEn = gRandom->Gaus(0.0,1.0); flag = 1;
01128       }
01129 
01130       // Atmos Track Energy (Exiting)
01131       flag = 0;
01132       while( !(deltaInputAtmosNumuTrkEnExit>-2.0 && deltaInputAtmosNumuTrkEnExit<+2.0 && flag) ){
01133         deltaInputAtmosNumuTrkEnExit = gRandom->Gaus(0.0,1.0); flag = 1;
01134       }
01135 
01136       // Atmos Shower Energy (Hadronic)
01137       flag = 0;
01138       while( !(deltaInputAtmosNumuShwEn>-2.0 && deltaInputAtmosNumuShwEn<+2.0 && flag) ){
01139         deltaInputAtmosNumuShwEn = gRandom->Gaus(0.0,1.0); flag = 1;
01140       }
01141 
01142       // Atmos Shower Energy (Electromagnetic)
01143       flag = 0;
01144       while( !(deltaInputAtmosNueEnergy>-2.0 && deltaInputAtmosNueEnergy<+2.0 && flag) ){
01145         deltaInputAtmosNueEnergy = gRandom->Gaus(0.0,1.0); flag = 1;
01146       }
01147 
01148  
01149       // increment systematic parameters
01150       inputAtmosNormCV        += deltaInputAtmosNormCV;
01151       inputAtmosNormRock      += deltaInputAtmosNormRock;
01152       inputAtmosChgCV         += deltaInputAtmosChgCV;
01153       inputAtmosChgRock       += deltaInputAtmosChgRock;
01154       inputAtmosNueNorm       += deltaInputAtmosNueNorm;
01155       inputAtmosNueRatio      += deltaInputAtmosNueRatio;
01156       inputAtmosNCBkg         += deltaInputAtmosNCBkg;
01157       inputAtmosSpecNumuCV    += deltaInputAtmosSpecNumuCV;
01158       inputAtmosSpecNumuBarCV += deltaInputAtmosSpecNumuBarCV;
01159       inputAtmosSpecNueCV     += deltaInputAtmosSpecNueCV;
01160       inputAtmosSpecNueBarCV  += deltaInputAtmosSpecNueBarCV;
01161       inputAtmosSpecNuRock    += deltaInputAtmosSpecNuRock;
01162       inputAtmosSpecNuBarRock += deltaInputAtmosSpecNuBarRock;
01163       inputAtmosZenith        += deltaInputAtmosZenith;
01164       inputAtmosNumuTrkEn     += deltaInputAtmosNumuTrkEn;
01165       inputAtmosNumuTrkEnExit += deltaInputAtmosNumuTrkEnExit;
01166       inputAtmosNumuShwEn     += deltaInputAtmosNumuShwEn;
01167       inputAtmosNueEnergy     += deltaInputAtmosNueEnergy;
01168     }
01169   }
01170 
01171 
01172   // Correlated Systematics
01173   // ======================
01174   if( fCorrelatedSystematics ){
01175 
01176     if( Configuration::Instance()->GetExperiment()==OscFit::kMINOS ){
01177       if( UsingBeamData() ){
01178         inputBeamNumuTrkEnExit    = inputBeamNumuTrkEn;
01179         if( UsingAtmosData() ){
01180           inputAtmosNumuTrkEn     = inputBeamNumuTrkEn;
01181           inputAtmosNumuShwEn     = 0.7071*(inputAtmosNumuShwEn+inputBeamNumuShwEn);
01182         }
01183       }
01184     }
01185 
01186     else if( Configuration::Instance()->GetExperiment()==OscFit::kLBNE ){
01187       if( UsingBeamData() ){
01188         if( UsingAtmosData() ){
01189           inputAtmosNumuTrkEn     = inputBeamNumuTrkEn;
01190           inputAtmosNumuTrkEnExit = inputBeamNumuTrkEnExit;
01191           inputAtmosNumuShwEn     = inputBeamNumuShwEn;
01192           inputAtmosNueEnergy     = inputBeamNueEnergy;
01193         }
01194       }
01195     }
01196   }
01197 
01198 
01199   // Print input parameters
01200   // ======================
01201   std::cout << "  Input Parameters for Expt: " << std::endl;
01202   std::cout << "   osc_dmsq    = " << inputDmsq << std::endl;
01203   std::cout << "   osc_sinsq23 = " << inputSinsq23 << std::endl;
01204   std::cout << "   osc_sinsq13 = " << inputSinsq13 << std::endl;
01205   std::cout << "   osc_deltaCP = " << inputDeltaCP << std::endl;
01206 
01207   if( UsingBeamData() ){
01208     std::cout << "   beam_numu_norm        = " << inputBeamNumuNorm << std::endl;
01209     std::cout << "   beam_numu_ncbkg       = " << inputBeamNumuNCBkg << std::endl;
01210     std::cout << "   beam_numu_shwen       = " << inputBeamNumuShwEn << std::endl;
01211     std::cout << "   beam_numu_trken       = " << inputBeamNumuTrkEn << std::endl;
01212     std::cout << "   beam_numu_trken_exit  = " << inputBeamNumuTrkEnExit << std::endl;
01213     std::cout << "   beam_nue_norm         = " << inputBeamNueNorm << std::endl;
01214     std::cout << "   beam_nue_ncbkg        = " << inputBeamNueNCBkg << std::endl;
01215     std::cout << "   beam_nue_energy       = " << inputBeamNueEnergy << std::endl;
01216   }
01217 
01218   if( UsingAtmosData() ){
01219     std::cout << "   atmos_norm_cv         = " << inputAtmosNormCV << std::endl;
01220     std::cout << "   atmos_norm_rock       = " << inputAtmosNormRock << std::endl; 
01221     std::cout << "   atmos_chg_cv          = " << inputAtmosChgCV << std::endl;
01222     std::cout << "   atmos_chg_rock        = " << inputAtmosChgRock << std::endl; 
01223     std::cout << "   atmos_nue_norm        = " << inputAtmosNueNorm << std::endl; 
01224     std::cout << "   atmos_nue_ratio       = " << inputAtmosNueRatio << std::endl;     
01225     std::cout << "   atmos_ncbkg           = " << inputAtmosNCBkg << std::endl;
01226     std::cout << "   atmos_spec_cv_numu    = " << inputAtmosSpecNumuCV << std::endl;  
01227     std::cout << "   atmos_spec_cv_numubar = " << inputAtmosSpecNumuBarCV << std::endl;
01228     std::cout << "   atmos_spec_cv_nue     = " << inputAtmosSpecNueCV << std::endl;  
01229     std::cout << "   atmos_spec_cv_nuebar  = " << inputAtmosSpecNueBarCV << std::endl; 
01230     std::cout << "   atmos_spec_rock_nu    = " << inputAtmosSpecNuRock << std::endl;  
01231     std::cout << "   atmos_spec_rock_nubar = " << inputAtmosSpecNuBarRock << std::endl;
01232     std::cout << "   atmos_zenith          = " << inputAtmosZenith << std::endl;
01233     std::cout << "   atmos_numu_trken      = " << inputAtmosNumuTrkEn << std::endl;   
01234     std::cout << "   atmos_numu_trken_exit = " << inputAtmosNumuTrkEnExit << std::endl;   
01235     std::cout << "   atmos_numu_shwen      = " << inputAtmosNumuShwEn << std::endl;
01236     std::cout << "   atmos_nue_energy      = " << inputAtmosNueEnergy << std::endl;
01237   }
01238 
01239   // Build mock data with fluctuations
01240   // =================================
01241   if( fMockDataWithFluctuations ){
01242     TemplateCalculator::Instance()->GetExperiment( inputDmsq,            inputSinsq23,
01243                                                    inputSinsq13,         inputDeltaCP,
01244                                                    inputBeamNumuNorm,    inputBeamNumuNCBkg,
01245                                                    inputBeamNumuShwEn,   inputBeamNumuTrkEn,
01246                                                    inputBeamNumuTrkEnExit,
01247                                                    inputBeamNueNorm,     inputBeamNueNCBkg,
01248                                                    inputBeamNueEnergy, 
01249                                                    inputAtmosNormCV,     inputAtmosNormRock,
01250                                                    inputAtmosChgCV,      inputAtmosChgRock,
01251                                                    inputAtmosNueNorm,    inputAtmosNueRatio,     
01252                                                    inputAtmosNCBkg,
01253                                                    inputAtmosSpecNumuCV, inputAtmosSpecNumuBarCV,
01254                                                    inputAtmosSpecNueCV,  inputAtmosSpecNueBarCV,
01255                                                    inputAtmosSpecNuRock, inputAtmosSpecNuBarRock,
01256                                                    inputAtmosZenith,
01257                                                    inputAtmosNumuTrkEn,  inputAtmosNumuTrkEnExit, 
01258                                                    inputAtmosNumuShwEn,  inputAtmosNueEnergy,  
01259                                                    fTemplateExpt );
01260   }
01261 
01262   // build mock data without fluctuations
01263   else{
01264     TemplateCalculator::Instance()->GetExpectation( inputDmsq,            inputSinsq23,
01265                                                     inputSinsq13,         inputDeltaCP,
01266                                                     inputBeamNumuNorm,    inputBeamNumuNCBkg,
01267                                                     inputBeamNumuShwEn,   inputBeamNumuTrkEn,  
01268                                                     inputBeamNumuTrkEnExit, 
01269                                                     inputBeamNueNorm,     inputBeamNueNCBkg,
01270                                                     inputBeamNueEnergy,  
01271                                                     inputAtmosNormCV,     inputAtmosNormRock,
01272                                                     inputAtmosChgCV,      inputAtmosChgRock,
01273                                                     inputAtmosNueNorm,    inputAtmosNueRatio,         
01274                                                     inputAtmosNCBkg,
01275                                                     inputAtmosSpecNumuCV, inputAtmosSpecNumuBarCV,
01276                                                     inputAtmosSpecNueCV,  inputAtmosSpecNueBarCV,
01277                                                     inputAtmosSpecNuRock, inputAtmosSpecNuBarRock,
01278                                                     inputAtmosZenith,
01279                                                     inputAtmosNumuTrkEn,  inputAtmosNumuTrkEnExit, 
01280                                                     inputAtmosNumuShwEn,  inputAtmosNueEnergy,  
01281                                                     fTemplateExpt);
01282   }
01283   
01284   // print experiment
01285   this->PrintExpt();
01286 
01287   // check experiment
01288   assert( TouchExpt() );
01289 
01290   return;
01291 }

void ThreeFlavourFitter::BuildGrid (  ) 

Definition at line 649 of file ThreeFlavourFitter.cxx.

References BuildGridDeltaCP(), BuildGridDmsq(), BuildGridSinsq13(), and BuildGridSinsq23().

00650 {
00651   BuildGridDmsq();
00652   BuildGridSinsq23();
00653   BuildGridSinsq13();
00654   BuildGridDeltaCP();
00655 }

void ThreeFlavourFitter::BuildGridDeltaCP ( Int_t  n,
Double_t  min,
Double_t  max 
)

Definition at line 729 of file ThreeFlavourFitter.cxx.

References fDeltaCPBins, fDeltaCPMax, and fDeltaCPMin.

00730 {
00731   std::cout << " *** ThreeFlavourFitter::BuildGridDeltaCP(...) *** " << std::endl;
00732   std::cout << "  bins=" << n << " (min=" << min << ", max=" << max << ") " << std::endl;
00733 
00734   fDeltaCPBins = n;
00735   fDeltaCPMin  = min;
00736   fDeltaCPMax  = max;
00737   
00738   return;
00739 }

void ThreeFlavourFitter::BuildGridDeltaCP (  ) 

Definition at line 720 of file ThreeFlavourFitter.cxx.

References GetDeltaCP(), GetDeltaCPBins(), Instance(), max, min, and n.

Referenced by BuildGrid().

00721 {
00722   Int_t n      = TemplateGrid::Instance()->GetDeltaCPBins()-1;
00723   Double_t min = TemplateGrid::Instance()->GetDeltaCP( 1 );
00724   Double_t max = TemplateGrid::Instance()->GetDeltaCP( n );
00725 
00726   BuildGridDeltaCP( n, min, max );
00727 }

void ThreeFlavourFitter::BuildGridDmsq ( Int_t  n,
Double_t  min,
Double_t  max 
)

Definition at line 666 of file ThreeFlavourFitter.cxx.

References fDmsqBins, fDmsqMax, and fDmsqMin.

00667 {
00668   std::cout << " *** ThreeFlavourFitter::BuildGridDmsq(...) *** " << std::endl;
00669   std::cout << "  bins=" << n << " (min=" << min << ", max=" << max << ") " << std::endl;
00670   
00671   fDmsqBins = n;
00672   fDmsqMin  = min;
00673   fDmsqMax  = max;
00674 
00675   return;
00676 }

void ThreeFlavourFitter::BuildGridDmsq (  ) 

Definition at line 657 of file ThreeFlavourFitter.cxx.

References GetDmsq(), GetDmsqBins(), Instance(), max, min, and n.

Referenced by BuildGrid().

00658 {
00659   Int_t n      = TemplateGrid::Instance()->GetDmsqBins()-1;
00660   Double_t min = TemplateGrid::Instance()->GetDmsq( 1 );
00661   Double_t max = TemplateGrid::Instance()->GetDmsq( n );
00662 
00663   BuildGridDmsq( n, min, max );
00664 }

void ThreeFlavourFitter::BuildGridSinsq13 ( Int_t  n,
Double_t  min,
Double_t  max 
)

Definition at line 708 of file ThreeFlavourFitter.cxx.

References fSinsq13Bins, fSinsq13Max, and fSinsq13Min.

00709 {
00710   std::cout << " *** ThreeFlavourFitter::BuildGridSinsq13(...) *** " << std::endl;
00711   std::cout << "  bins=" << n << " (min=" << min << ", max=" << max << ") " << std::endl;
00712 
00713   fSinsq13Bins = n;
00714   fSinsq13Min  = min;
00715   fSinsq13Max  = max;
00716   
00717   return;
00718 }

void ThreeFlavourFitter::BuildGridSinsq13 (  ) 

Definition at line 699 of file ThreeFlavourFitter.cxx.

References GetSinsq13(), GetSinsq13Bins(), Instance(), max, min, and n.

Referenced by BuildGrid().

00700 {
00701   Int_t n      = TemplateGrid::Instance()->GetSinsq13Bins()-1;
00702   Double_t min = TemplateGrid::Instance()->GetSinsq13( 1 );
00703   Double_t max = TemplateGrid::Instance()->GetSinsq13( n );
00704 
00705   BuildGridSinsq13( n, min, max );
00706 }

void ThreeFlavourFitter::BuildGridSinsq23 ( Int_t  n,
Double_t  min,
Double_t  max 
)

Definition at line 687 of file ThreeFlavourFitter.cxx.

References fSinsq23Bins, fSinsq23Max, and fSinsq23Min.

00688 {
00689   std::cout << " *** ThreeFlavourFitter::BuildGridSinsq23(...) *** " << std::endl;
00690   std::cout << "  bins=" << n << " (min=" << min << ", max=" << max << ") " << std::endl;
00691 
00692   fSinsq23Bins = n;
00693   fSinsq23Min  = min;
00694   fSinsq23Max  = max;
00695   
00696   return;
00697 }

void ThreeFlavourFitter::BuildGridSinsq23 (  ) 

Definition at line 678 of file ThreeFlavourFitter.cxx.

References GetSinsq23(), GetSinsq23Bins(), Instance(), max, min, and n.

Referenced by BuildGrid().

00679 {
00680   Int_t n      = TemplateGrid::Instance()->GetSinsq23Bins()-1;
00681   Double_t min = TemplateGrid::Instance()->GetSinsq23( 1 );
00682   Double_t max = TemplateGrid::Instance()->GetSinsq23( n );
00683 
00684   BuildGridSinsq23( n, min, max );
00685 }

void ThreeFlavourFitter::CalcProfileCPV ( Bool_t  isSensitivity = 1,
Bool_t  isNormal = 1,
Int_t  ifirst = -1,
Int_t  ilast = -1 
)

Definition at line 1354 of file ThreeFlavourFitter.cxx.

References BuildExpt(), fBigNumber, fFitDeltaCP, fInputDeltaCP, fInputDmsq, fInputSinsq13, fInputSinsq23, fMockData, fOutFile, GetDeltaCP(), GetDeltaCPBins(), GetDeltaCPMax(), GetDeltaCPMin(), GetLikelihood(), PrintGrid(), PrintSettings(), and TouchExpt().

01355 {
01356   std::cout << " *** ThreeFlavourFitter::CalcProfileCPV(...) *** " << std::endl;
01357 
01358   // Sanity Checks
01359   // =============
01360   if( !isSensitivity ){
01361     std::cout << "   <warning> isSensitivity=false, Wrong settings for sensitivity plots " << std::endl;
01362     assert(0);
01363   }
01364 
01365   if( !fMockData ){
01366     std::cout << "   <warning> simulatedData=false, Wrong settings for sensitivity plots " << std::endl;
01367     assert(0);
01368   }
01369 
01370   if( GetDeltaCPBins()<=0 ){
01371     std::cout << "   <warning> No DeltaCP grid " << std::endl;
01372     assert(0);
01373   }
01374 
01375   // Print Grid
01376   // ==========
01377   this->PrintGrid();
01378 
01379   // Print Settings
01380   // ==============
01381   this->PrintSettings();
01382 
01383   // Build Experiments
01384   // =================
01385   if( this->TouchExpt()==0 ){
01386     this->BuildExpt();
01387   }
01388 
01389   // Build Histograms
01390   // ================  
01391   // x-axis: DeltaCP
01392 
01393   Int_t nx = GetDeltaCPBins();
01394   Double_t xlow = GetDeltaCPMin();
01395   Double_t xhigh = GetDeltaCPMax();
01396   Double_t dx = (xhigh-xlow)/((double)nx-1.0);
01397   Double_t xmin = xlow  - 0.50*dx;
01398   Double_t xmax = xhigh + 0.50*dx;
01399   
01400   TH1D* hLnLTotal = new TH1D("hLnLTotal", "", nx,xmin,xmax);
01401   hLnLTotal->GetYaxis()->SetTitle("#DeltaLog(L)");
01402   hLnLTotal->GetXaxis()->SetTitle("#delta_{CP}");
01403   hLnLTotal->GetYaxis()->CenterTitle();
01404   hLnLTotal->GetXaxis()->CenterTitle();
01405 
01406   TH1D* hLnL = new TH1D("hLnL", "", nx,xmin,xmax);
01407   hLnL->GetYaxis()->SetTitle("#DeltaLog(L)");
01408   hLnL->GetXaxis()->SetTitle("#delta_{CP}");
01409   hLnL->GetYaxis()->CenterTitle();
01410   hLnL->GetXaxis()->CenterTitle();
01411 
01412   TH1D* hSigma = new TH1D("hLnLSigma", "", nx,xmin,xmax);
01413   hSigma->GetYaxis()->SetTitle("Standard Deviations");
01414   hSigma->GetXaxis()->SetTitle("#delta_{CP}");
01415   hSigma->GetYaxis()->CenterTitle();
01416   hSigma->GetXaxis()->CenterTitle();
01417 
01418 
01419   //
01420   // Print Binning
01421   // -------------
01422   //
01423   // std::cout << " --- sinsq23 --- " << std::endl;
01424   // for( Int_t n=0; n<hLnL->GetXaxis()->GetNbins(); n++ ){
01425   //   std::cout << " [" << n << "] " << hLnL->GetXaxis()->GetBinCenter(n+1) << std::endl;
01426   // }
01427   //
01428 
01429  
01430   // Run Oscillation Fit
01431   // ==================
01432   Double_t LnL = 0.0;
01433   Double_t LnL_0 = 0.0;
01434   Double_t LnL_pi = 0.0;
01435   Double_t minLnL = fBigNumber;
01436 
01437   Double_t saveInputDmsq    = fInputDmsq;
01438   Double_t saveInputDeltaCP = fInputDeltaCP;
01439   Bool_t   saveFitDeltaCP   = fFitDeltaCP;
01440   
01441   fFitDeltaCP = 0; // switch off deltaCP in fit
01442 
01443   Int_t first = ifirst;
01444   Int_t last  = ilast;
01445 
01446   if( first<0 ) first = 0;
01447   if( last<0 )  last  = GetDeltaCPBins();
01448   if( last>GetDeltaCPBins() ) last = GetDeltaCPBins();
01449 
01450   // Print Warning Message
01451   if( isSensitivity ){
01452     if( ( isNormal==true  && saveInputDmsq<0 )
01453      || ( isNormal==false && saveInputDmsq>0 ) ){
01454       std::cout << "   <warning> overriding input oscillations: sign(dm2) will change  " << std::endl;
01455     }
01456   }
01457 
01458   // Loop over DeltaCP Bins (x-axis)
01459   std::cout << " *** RunFit [FirstBin=" << first << ", LastBin=" << last << "] *** " << std::endl;
01460   for( Int_t i=first; i<last; i++ ){          
01461     std::cout << " ---- RunFit: [" << i << "] ---- " << std::endl;
01462 
01463     // Define Input Parameters
01464     fInputDmsq    = fabs(saveInputDmsq);
01465     fInputDeltaCP = GetDeltaCP( i );    
01466 
01467     if( isNormal==0 ) fInputDmsq = -fInputDmsq;
01468 
01469     // Generate Experiment     
01470     BuildExpt();
01471     
01472     // Run Fit
01473     LnL_0 = this->GetLikelihood( fInputDmsq,    fInputSinsq23,
01474                                  fInputSinsq13, 0.0 );
01475 
01476     LnL_pi = this->GetLikelihood( fInputDmsq,    fInputSinsq23,
01477                                   fInputSinsq13, TMath::Pi() );
01478    
01479     if( LnL_0<LnL_pi ) LnL = LnL_0; 
01480     else               LnL = LnL_pi;
01481   
01482     hLnL->SetBinContent( i+1, LnL );
01483     hLnLTotal->SetBinContent( i+1, LnL );
01484 
01485     // Best Fit
01486     if( LnL<minLnL ) minLnL = LnL;
01487   }
01488 
01489   
01490   // Best Fit Oscillations
01491   // ===================== 
01492   for( Int_t i=0; i<hLnL->GetXaxis()->GetNbins(); i++ ){
01493     Double_t myLnL = hLnL->GetBinContent( i+1 );
01494     Double_t myLnLSubtracted = myLnL;
01495     Double_t mySigmaSubtracted = sqrt(fabs(2.0*myLnLSubtracted));
01496       
01497     hLnL->SetBinContent( i+1, myLnLSubtracted );
01498     hSigma->SetBinContent( i+1, mySigmaSubtracted );
01499   }
01500 
01501 
01502   // Write Output Histograms
01503   // =======================
01504   if( 1 ){ // always write this file...
01505 
01506     TString filename = fOutFile;
01507     TString tag = ".output";
01508   
01509     if( filename.EndsWith(".root") )
01510       filename.Insert(filename.Length()-5,tag);
01511     else filename.Append(tag);
01512 
01513     std::cout << " *** ThreeFlavourFitter::WriteContours() *** " << std::endl;
01514     std::cout << "   Writing Likelihood Profile to File: " << filename.Data() << std::endl;
01515 
01516     TDirectory* tmpd = gDirectory;
01517     TFile* file = new TFile(filename.Data(),"recreate");
01518 
01519     hLnL->Write();
01520     hLnLTotal->Write();
01521     hSigma->Write();
01522 
01523     file->Close();
01524     tmpd->cd();
01525   }
01526 
01527   // retrieve saved parameters
01528   fInputDmsq    = saveInputDmsq;
01529   fInputDeltaCP = saveInputDeltaCP;
01530   fFitDeltaCP   = saveFitDeltaCP;
01531 
01532   return;
01533 }

void ThreeFlavourFitter::CalcProfileDeltaCP ( Bool_t  isSensitivity = 1,
Bool_t  isNormal = 1,
Int_t  ifirst = -1,
Int_t  ilast = -1 
)

Definition at line 1535 of file ThreeFlavourFitter.cxx.

References BuildExpt(), fBigNumber, fFitDeltaCP, fFitHierarchy, fFixOctant, fInputDeltaCP, fInputDmsq, fMockData, fOutFile, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, GetDeltaCP(), GetDeltaCPBins(), GetDeltaCPMax(), GetDeltaCPMin(), PrintGrid(), PrintSettings(), RunFit(), TouchExpt(), UsingAtmosData(), and UsingBeamData().

01536 {
01537   std::cout << " *** ThreeFlavourFitter::CalcProfileDeltaCP(...) *** " << std::endl;
01538 
01539   // Sanity Checks
01540   // =============
01541   if( isSensitivity && !fMockData ){
01542     std::cout << "   <warning> isSensitivity=true, simulatedData=false " << std::endl
01543               << "             Wrong settings for sensitivity plots " << std::endl;
01544     assert(0);
01545   }
01546 
01547   if( GetDeltaCPBins()<=0 ){
01548     std::cout << "   <warning> No DeltaCP grid " << std::endl;
01549     assert(0);
01550   }
01551 
01552   // Print Grid
01553   // ==========
01554   this->PrintGrid();
01555 
01556   // Print Settings
01557   // ==============
01558   this->PrintSettings();
01559 
01560   // Build Experiments
01561   // =================
01562   if( this->TouchExpt()==0 ){
01563     this->BuildExpt();
01564   }
01565 
01566   // Build Histograms
01567   // ================  
01568   // x-axis: DeltaCP
01569 
01570   Int_t nx = GetDeltaCPBins();
01571   Double_t xlow = GetDeltaCPMin();
01572   Double_t xhigh = GetDeltaCPMax();
01573   Double_t dx = (xhigh-xlow)/((double)nx-1.0);
01574   Double_t xmin = xlow  - 0.50*dx;
01575   Double_t xmax = xhigh + 0.50*dx;
01576   
01577   TH1D* hHierarchy = new TH1D("hHierarchy", "", nx,xmin,xmax);
01578   TH1D* hDmsq      = new TH1D("hDmsq",      "", nx,xmin,xmax);
01579   TH1D* hSinsq23   = new TH1D("hSinsq23",   "", nx,xmin,xmax);
01580   TH1D* hSinsq13   = new TH1D("hSinsq13",   "", nx,xmin,xmax);
01581   TH1D* hDeltaCP   = new TH1D("hDeltaCP",   "", nx,xmin,xmax);
01582 
01583   TH1D* hBeamNumuNorm  = new TH1D("hBeamNumuNorm", "", nx,xmin,xmax); 
01584   hBeamNumuNorm->GetYaxis()->SetTitle("Shift / #sigma");
01585   hBeamNumuNorm->GetXaxis()->SetTitle("#delta_{CP}");
01586   hBeamNumuNorm->GetYaxis()->CenterTitle();
01587   hBeamNumuNorm->GetXaxis()->CenterTitle();
01588 
01589   TH1D* hBeamNumuNCBkg = new TH1D("hBeamNumuNCBkg","", nx,xmin,xmax);
01590   hBeamNumuNCBkg->GetYaxis()->SetTitle("Shift / #sigma");
01591   hBeamNumuNCBkg->GetXaxis()->SetTitle("#delta_{CP}");
01592   hBeamNumuNCBkg->GetYaxis()->CenterTitle();
01593   hBeamNumuNCBkg->GetXaxis()->CenterTitle();
01594 
01595   TH1D* hBeamNumuShwEn = new TH1D("hBeamNumuShwEn","", nx,xmin,xmax);  
01596   hBeamNumuShwEn->GetYaxis()->SetTitle("Shift / #sigma");
01597   hBeamNumuShwEn->GetXaxis()->SetTitle("#delta_{CP}");
01598   hBeamNumuShwEn->GetYaxis()->CenterTitle();
01599   hBeamNumuShwEn->GetXaxis()->CenterTitle();
01600 
01601   TH1D* hBeamNumuTrkEn = new TH1D("hBeamNumuTrkEn","", nx,xmin,xmax);
01602   hBeamNumuTrkEn->GetYaxis()->SetTitle("Shift / #sigma");
01603   hBeamNumuTrkEn->GetXaxis()->SetTitle("#delta_{CP}");
01604   hBeamNumuTrkEn->GetYaxis()->CenterTitle();
01605   hBeamNumuTrkEn->GetXaxis()->CenterTitle();
01606 
01607   TH1D* hBeamNumuTrkEnExit = new TH1D("hBeamNumuTrkEnExit","", nx,xmin,xmax);
01608   hBeamNumuTrkEnExit->GetYaxis()->SetTitle("Shift / #sigma");
01609   hBeamNumuTrkEnExit->GetXaxis()->SetTitle("#delta_{CP}");
01610   hBeamNumuTrkEnExit->GetYaxis()->CenterTitle();
01611   hBeamNumuTrkEnExit->GetXaxis()->CenterTitle();
01612 
01613   TH1D* hBeamNueNorm  = new TH1D("hBeamNueNorm", "", nx,xmin,xmax); 
01614   hBeamNueNorm->GetYaxis()->SetTitle("Shift / #sigma");
01615   hBeamNueNorm->GetXaxis()->SetTitle("#delta_{CP}");
01616   hBeamNueNorm->GetYaxis()->CenterTitle();
01617   hBeamNueNorm->GetXaxis()->CenterTitle();
01618 
01619   TH1D* hBeamNueNCBkg = new TH1D("hBeamNueNCBkg","", nx,xmin,xmax);
01620   hBeamNueNCBkg->GetYaxis()->SetTitle("Shift / #sigma");
01621   hBeamNueNCBkg->GetXaxis()->SetTitle("#delta_{CP}");
01622   hBeamNueNCBkg->GetYaxis()->CenterTitle();
01623   hBeamNueNCBkg->GetXaxis()->CenterTitle();
01624 
01625   TH1D* hBeamNueEnergy = new TH1D("hBeamNueEnergy","", nx,xmin,xmax);  
01626   hBeamNueEnergy->GetYaxis()->SetTitle("Shift / #sigma");
01627   hBeamNueEnergy->GetXaxis()->SetTitle("#delta_{CP}");
01628   hBeamNueEnergy->GetYaxis()->CenterTitle();
01629   hBeamNueEnergy->GetXaxis()->CenterTitle();
01630 
01631   TH1D* hAtmosNormCV = new TH1D("hAtmosNormCV","", nx,xmin,xmax);
01632   hAtmosNormCV->GetYaxis()->SetTitle("Shift / #sigma");
01633   hAtmosNormCV->GetXaxis()->SetTitle("#delta_{CP}");
01634   hAtmosNormCV->GetYaxis()->CenterTitle();
01635   hAtmosNormCV->GetXaxis()->CenterTitle();
01636 
01637   TH1D* hAtmosNormRock = new TH1D("hAtmosNormRock","", nx,xmin,xmax);
01638   hAtmosNormRock->GetYaxis()->SetTitle("Shift / #sigma");
01639   hAtmosNormRock->GetXaxis()->SetTitle("#delta_{CP}");
01640   hAtmosNormRock->GetYaxis()->CenterTitle();
01641   hAtmosNormRock->GetXaxis()->CenterTitle();
01642 
01643   TH1D* hAtmosChgCV = new TH1D("hAtmosChgCV","", nx,xmin,xmax);
01644   hAtmosChgCV->GetYaxis()->SetTitle("Shift / #sigma");
01645   hAtmosChgCV->GetXaxis()->SetTitle("#delta_{CP}");
01646   hAtmosChgCV->GetYaxis()->CenterTitle();
01647   hAtmosChgCV->GetXaxis()->CenterTitle();
01648 
01649   TH1D* hAtmosChgRock = new TH1D("hAtmosChgRock","", nx,xmin,xmax);
01650   hAtmosChgRock->GetYaxis()->SetTitle("Shift / #sigma");
01651   hAtmosChgRock->GetXaxis()->SetTitle("#delta_{CP}");
01652   hAtmosChgRock->GetYaxis()->CenterTitle();
01653   hAtmosChgRock->GetXaxis()->CenterTitle();
01654 
01655   TH1D* hAtmosNueNorm = new TH1D("hAtmosNueNorm","", nx,xmin,xmax);
01656   hAtmosNueNorm->GetYaxis()->SetTitle("Shift / #sigma");
01657   hAtmosNueNorm->GetXaxis()->SetTitle("#delta_{CP}");
01658   hAtmosNueNorm->GetYaxis()->CenterTitle();
01659   hAtmosNueNorm->GetXaxis()->CenterTitle();
01660 
01661   TH1D* hAtmosNueRatio = new TH1D("hAtmosNueRatio","", nx,xmin,xmax);
01662   hAtmosNueRatio->GetYaxis()->SetTitle("Shift / #sigma");
01663   hAtmosNueRatio->GetXaxis()->SetTitle("#delta_{CP}");
01664   hAtmosNueRatio->GetYaxis()->CenterTitle();
01665   hAtmosNueRatio->GetXaxis()->CenterTitle();
01666 
01667   TH1D* hAtmosNCBkg = new TH1D("hAtmosNCBkg","", nx,xmin,xmax);
01668   hAtmosNCBkg->GetYaxis()->SetTitle("Shift / #sigma");
01669   hAtmosNCBkg->GetXaxis()->SetTitle("#delta_{CP}");
01670   hAtmosNCBkg->GetYaxis()->CenterTitle();
01671   hAtmosNCBkg->GetXaxis()->CenterTitle();
01672 
01673   TH1D* hAtmosSpecNumuCV = new TH1D("hAtmosSpecNumuCV","", nx,xmin,xmax);
01674   hAtmosSpecNumuCV->GetYaxis()->SetTitle("Shift / #sigma");
01675   hAtmosSpecNumuCV->GetXaxis()->SetTitle("#delta_{CP}");
01676   hAtmosSpecNumuCV->GetYaxis()->CenterTitle();
01677   hAtmosSpecNumuCV->GetXaxis()->CenterTitle();
01678 
01679   TH1D* hAtmosSpecNumuBarCV = new TH1D("hAtmosSpecNumuBarCV","", nx,xmin,xmax);
01680   hAtmosSpecNumuBarCV->GetYaxis()->SetTitle("Shift / #sigma");
01681   hAtmosSpecNumuBarCV->GetXaxis()->SetTitle("#delta_{CP}");
01682   hAtmosSpecNumuBarCV->GetYaxis()->CenterTitle();
01683   hAtmosSpecNumuBarCV->GetXaxis()->CenterTitle();   
01684 
01685   TH1D* hAtmosSpecNueCV = new TH1D("hAtmosSpecNueCV","", nx,xmin,xmax);
01686   hAtmosSpecNueCV->GetYaxis()->SetTitle("Shift / #sigma");
01687   hAtmosSpecNueCV->GetXaxis()->SetTitle("#delta_{CP}");
01688   hAtmosSpecNueCV->GetYaxis()->CenterTitle();
01689   hAtmosSpecNueCV->GetXaxis()->CenterTitle();
01690 
01691   TH1D* hAtmosSpecNueBarCV = new TH1D("hAtmosSpecNueBarCV","", nx,xmin,xmax);
01692   hAtmosSpecNueBarCV->GetYaxis()->SetTitle("Shift / #sigma");
01693   hAtmosSpecNueBarCV->GetXaxis()->SetTitle("#delta_{CP}");
01694   hAtmosSpecNueBarCV->GetYaxis()->CenterTitle();
01695   hAtmosSpecNueBarCV->GetXaxis()->CenterTitle();  
01696 
01697   TH1D* hAtmosSpecNuRock = new TH1D("hAtmosSpecNuRock","", nx,xmin,xmax);
01698   hAtmosSpecNuRock->GetYaxis()->SetTitle("Shift / #sigma");
01699   hAtmosSpecNuRock->GetXaxis()->SetTitle("#delta_{CP}");
01700   hAtmosSpecNuRock->GetYaxis()->CenterTitle();
01701   hAtmosSpecNuRock->GetXaxis()->CenterTitle();
01702 
01703   TH1D* hAtmosSpecNuBarRock = new TH1D("hAtmosSpecNuBarRock","", nx,xmin,xmax);
01704   hAtmosSpecNuBarRock->GetYaxis()->SetTitle("Shift / #sigma");
01705   hAtmosSpecNuBarRock->GetXaxis()->SetTitle("#delta_{CP}");
01706   hAtmosSpecNuBarRock->GetYaxis()->CenterTitle();
01707   hAtmosSpecNuBarRock->GetXaxis()->CenterTitle();
01708 
01709   TH1D* hAtmosZenith = new TH1D("hAtmosZenith","", nx,xmin,xmax);
01710   hAtmosZenith->GetYaxis()->SetTitle("Shift / #sigma");
01711   hAtmosZenith->GetXaxis()->SetTitle("#delta_{CP}");
01712   hAtmosZenith->GetYaxis()->CenterTitle();
01713   hAtmosZenith->GetXaxis()->CenterTitle();
01714 
01715   TH1D* hAtmosNumuTrkEn = new TH1D("hAtmosNumuTrkEn","", nx,xmin,xmax);
01716   hAtmosNumuTrkEn->GetYaxis()->SetTitle("Shift / #sigma");
01717   hAtmosNumuTrkEn->GetXaxis()->SetTitle("#delta_{CP}");
01718   hAtmosNumuTrkEn->GetYaxis()->CenterTitle();
01719   hAtmosNumuTrkEn->GetXaxis()->CenterTitle();
01720 
01721   TH1D* hAtmosNumuTrkEnExit = new TH1D("hAtmosNumuTrkEnExit","", nx,xmin,xmax);
01722   hAtmosNumuTrkEnExit->GetYaxis()->SetTitle("Shift / #sigma");
01723   hAtmosNumuTrkEnExit->GetXaxis()->SetTitle("#delta_{CP}");
01724   hAtmosNumuTrkEnExit->GetYaxis()->CenterTitle();
01725   hAtmosNumuTrkEnExit->GetXaxis()->CenterTitle();
01726 
01727   TH1D* hAtmosNumuShwEn = new TH1D("hAtmosNumuShwEn","", nx,xmin,xmax);
01728   hAtmosNumuShwEn->GetYaxis()->SetTitle("Shift / #sigma");
01729   hAtmosNumuShwEn->GetXaxis()->SetTitle("#delta_{CP}");
01730   hAtmosNumuShwEn->GetYaxis()->CenterTitle();
01731   hAtmosNumuShwEn->GetXaxis()->CenterTitle();
01732 
01733   TH1D* hAtmosNueEnergy = new TH1D("hAtmosNueEnergy","", nx,xmin,xmax);
01734   hAtmosNueEnergy->GetYaxis()->SetTitle("Shift / #sigma");
01735   hAtmosNueEnergy->GetXaxis()->SetTitle("#delta_{CP}");
01736   hAtmosNueEnergy->GetYaxis()->CenterTitle();
01737   hAtmosNueEnergy->GetXaxis()->CenterTitle();
01738 
01739   TH1D* hLnLTotal = new TH1D("hLnLTotal", "", nx,xmin,xmax);
01740   hLnLTotal->GetYaxis()->SetTitle("#DeltaLog(L)");
01741   hLnLTotal->GetXaxis()->SetTitle("#delta_{CP}");
01742   hLnLTotal->GetYaxis()->CenterTitle();
01743   hLnLTotal->GetXaxis()->CenterTitle();
01744 
01745   TH1D* hLnL = new TH1D("hLnL", "", nx,xmin,xmax);
01746   hLnL->GetYaxis()->SetTitle("#DeltaLog(L)");
01747   hLnL->GetXaxis()->SetTitle("#delta_{CP}");
01748   hLnL->GetYaxis()->CenterTitle();
01749   hLnL->GetXaxis()->CenterTitle();
01750 
01751   TH1D* hSigma = new TH1D("hLnLSigma", "", nx,xmin,xmax);
01752   hSigma->GetYaxis()->SetTitle("Standard Deviations");
01753   hSigma->GetXaxis()->SetTitle("#delta_{CP}");
01754   hSigma->GetYaxis()->CenterTitle();
01755   hSigma->GetXaxis()->CenterTitle();
01756 
01757 
01758   //
01759   // Print Binning
01760   // -------------
01761   //
01762   // std::cout << " --- sinsq23 --- " << std::endl;
01763   // for( Int_t n=0; n<hLnL->GetXaxis()->GetNbins(); n++ ){
01764   //   std::cout << " [" << n << "] " << hLnL->GetXaxis()->GetBinCenter(n+1) << std::endl;
01765   // }
01766   //
01767 
01768  
01769   // Run Oscillation Fit
01770   // ==================
01771   Double_t input_dmsq    = 0.0;
01772   Double_t input_sinsq23 = 0.0;
01773   Double_t input_sinsq13 = 0.0;
01774   Double_t input_deltaCP = 0.0;
01775   
01776   Double_t osc_hierarchy         = 0.0;
01777   Double_t osc_dmsq              = 0.0;
01778   Double_t osc_sinsq23           = 0.0;
01779   Double_t osc_sinsq13           = 0.0;
01780   Double_t osc_deltaCP           = 0.0;
01781   Double_t beam_numu_norm        = 0.0;
01782   Double_t beam_numu_ncbkg       = 0.0;
01783   Double_t beam_numu_shwen       = 0.0;
01784   Double_t beam_numu_trken       = 0.0;
01785   Double_t beam_numu_trken_exit  = 0.0;
01786   Double_t beam_nue_norm         = 0.0;
01787   Double_t beam_nue_ncbkg        = 0.0;
01788   Double_t beam_nue_energy       = 0.0;
01789   Double_t atmos_norm_cv         = 0.0;
01790   Double_t atmos_norm_rock       = 0.0;
01791   Double_t atmos_chg_cv          = 0.0;
01792   Double_t atmos_chg_rock        = 0.0;
01793   Double_t atmos_nue_norm        = 0.0;
01794   Double_t atmos_nue_ratio       = 0.0;
01795   Double_t atmos_ncbkg           = 0.0;
01796   Double_t atmos_spec_cv_numu    = 0.0;
01797   Double_t atmos_spec_cv_numubar = 0.0;
01798   Double_t atmos_spec_cv_nue     = 0.0;
01799   Double_t atmos_spec_cv_nuebar  = 0.0;
01800   Double_t atmos_spec_rock_nu    = 0.0;
01801   Double_t atmos_spec_rock_nubar = 0.0;
01802   Double_t atmos_zenith          = 0.0;
01803   Double_t atmos_numu_trken      = 0.0;
01804   Double_t atmos_numu_trken_exit = 0.0;
01805   Double_t atmos_numu_shwen      = 0.0;
01806   Double_t atmos_nue_energy      = 0.0;
01807 
01808   Double_t output_dmsq      = 0.0;
01809 
01810   Double_t LnL = 0.0; 
01811   Double_t minLnL = fBigNumber;
01812 
01813   Double_t saveInputDmsq    = fInputDmsq;
01814   Double_t saveInputDeltaCP = fInputDeltaCP;
01815   Bool_t   saveFitDeltaCP   = fFitDeltaCP;
01816   Bool_t   saveFixOctant    = fFixOctant;
01817   Bool_t   saveFitHierarchy = fFitHierarchy;
01818 
01819   Int_t ibest = -1;
01820   Int_t first = ifirst;
01821   Int_t last  = ilast;
01822 
01823   if( first<0 ) first = 0;
01824   if( last<0 )  last  = GetDeltaCPBins();
01825   if( last>GetDeltaCPBins() ) last = GetDeltaCPBins();
01826 
01827   // Print Warning Message
01828   if( isSensitivity ){
01829     if( ( isNormal==true  && saveInputDmsq<0 )
01830      || ( isNormal==false && saveInputDmsq>0 ) ){
01831       std::cout << "   <warning> overriding input oscillations: sign(dm2) will change " << std::endl;
01832     }
01833   }
01834 
01835   // Loop over DeltaCP Bins (x-axis)
01836   std::cout << " *** RunFit [FirstBin=" << first << ", LastBin=" << last << "] *** " << std::endl;
01837   for( Int_t i=first; i<last; i++ ){          
01838     std::cout << " ---- RunFit: [" << i << "] ---- " << std::endl;
01839 
01840     // Seed Parameters
01841     input_dmsq    = fabs(fSeedDmsq); 
01842     input_sinsq23 = fSeedSinsq23;
01843     input_sinsq13 = fSeedSinsq13;
01844     input_deltaCP = GetDeltaCP( i );    
01845 
01846     if( isNormal==0 ) input_dmsq = -input_dmsq;
01847 
01848     // Generate New Experiment
01849     if( isSensitivity ){      
01850       fInputDmsq    = fabs(saveInputDmsq);
01851       fInputDeltaCP = input_deltaCP;
01852 
01853       if( isNormal==0 ) fInputDmsq = -fInputDmsq;
01854     
01855       BuildExpt();
01856     }
01857 
01858     // Fit Opposite Hierarchy
01859     if( isSensitivity ){
01860       input_dmsq    = -input_dmsq;
01861       fFitDeltaCP   = true;
01862       fFixOctant    = false;
01863       fFitHierarchy = false;
01864     }
01865 
01866     // Fit DeltaCP Parameter
01867     if( fFitDeltaCP ) input_deltaCP = fSeedDeltaCP;
01868 
01869     // Run Fit
01870     this->RunFit( input_dmsq,         input_sinsq23,
01871                   input_sinsq13,      input_deltaCP,
01872                   osc_dmsq,           osc_sinsq23,
01873                   osc_sinsq13,        osc_deltaCP,    
01874                   beam_numu_norm,     beam_numu_ncbkg,
01875                   beam_numu_shwen,    beam_numu_trken,
01876                   beam_numu_trken_exit,
01877                   beam_nue_norm,      beam_nue_ncbkg,
01878                   beam_nue_energy, 
01879                   atmos_norm_cv,      atmos_norm_rock, 
01880                   atmos_chg_cv,       atmos_chg_rock, 
01881                   atmos_nue_norm,     atmos_nue_ratio,     
01882                   atmos_ncbkg,
01883                   atmos_spec_cv_numu, atmos_spec_cv_numubar,
01884                   atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
01885                   atmos_spec_rock_nu, atmos_spec_rock_nubar,
01886                   atmos_zenith,
01887                   atmos_numu_trken,   atmos_numu_trken_exit,
01888                   atmos_numu_shwen,   atmos_nue_energy,
01889                   LnL );
01890 
01891     if( osc_dmsq>=0.0 ) osc_hierarchy = +1.0;
01892     else                osc_hierarchy = -1.0;
01893 
01894     hHierarchy->SetBinContent( i+1, osc_hierarchy );
01895     hDmsq->SetBinContent( i+1, fabs(osc_dmsq) );
01896     hSinsq23->SetBinContent( i+1, osc_sinsq23 );
01897     hSinsq13->SetBinContent( i+1, osc_sinsq13 );
01898     hDeltaCP->SetBinContent( i+1, osc_deltaCP );
01899 
01900     hBeamNumuNorm->SetBinContent( i+1, beam_numu_norm );
01901     hBeamNumuNCBkg->SetBinContent( i+1, beam_numu_ncbkg );
01902     hBeamNumuShwEn->SetBinContent( i+1, beam_numu_shwen );
01903     hBeamNumuTrkEn->SetBinContent( i+1, beam_numu_trken );
01904     hBeamNumuTrkEnExit->SetBinContent( i+1, beam_numu_trken_exit );
01905     hBeamNueNorm->SetBinContent( i+1, beam_nue_norm );
01906     hBeamNueNCBkg->SetBinContent( i+1, beam_nue_ncbkg );
01907     hBeamNueEnergy->SetBinContent( i+1, beam_nue_energy );
01908 
01909     hAtmosNormCV->SetBinContent( i+1, atmos_norm_cv );
01910     hAtmosNormRock->SetBinContent( i+1, atmos_norm_rock );
01911     hAtmosChgCV->SetBinContent( i+1,atmos_chg_cv );
01912     hAtmosChgRock->SetBinContent( i+1,atmos_chg_rock );
01913     hAtmosNueNorm->SetBinContent( i+1, atmos_nue_norm );
01914     hAtmosNueRatio->SetBinContent( i+1, atmos_nue_ratio );
01915     hAtmosNCBkg->SetBinContent( i+1, atmos_ncbkg );
01916     hAtmosSpecNumuCV->SetBinContent( i+1, atmos_spec_cv_numu );
01917     hAtmosSpecNumuBarCV->SetBinContent( i+1, atmos_spec_cv_numubar );
01918     hAtmosSpecNueCV->SetBinContent( i+1, atmos_spec_cv_nue );
01919     hAtmosSpecNueBarCV->SetBinContent( i+1, atmos_spec_cv_nuebar );
01920     hAtmosSpecNuRock->SetBinContent( i+1, atmos_spec_rock_nu );
01921     hAtmosSpecNuBarRock->SetBinContent( i+1, atmos_spec_rock_nubar );
01922     hAtmosZenith->SetBinContent( i+1, atmos_zenith );
01923     hAtmosNumuTrkEn->SetBinContent( i+1, atmos_numu_trken );
01924     hAtmosNumuTrkEnExit->SetBinContent( i+1, atmos_numu_trken_exit );
01925     hAtmosNumuShwEn->SetBinContent( i+1, atmos_numu_shwen );
01926     hAtmosNueEnergy->SetBinContent( i+1, atmos_nue_energy );
01927 
01928     hLnL->SetBinContent( i+1, LnL );
01929     hLnLTotal->SetBinContent( i+1, LnL );
01930 
01931     // Best Fit
01932     if( LnL<minLnL ){
01933       ibest = i; 
01934       minLnL = LnL;
01935     }
01936   }
01937 
01938   
01939   // Best Fit Oscillations
01940   // =====================
01941   if( ibest>=0 ){
01942  
01943     for( Int_t i=0; i<hLnL->GetXaxis()->GetNbins(); i++ ){
01944       Double_t myLnL = hLnL->GetBinContent( i+1 );
01945       Double_t myLnLSubtracted = myLnL;
01946     
01947       if( isSensitivity==false 
01948        && myLnL>0 && minLnL<=myLnL ) myLnLSubtracted = myLnL - minLnL;
01949 
01950       Double_t mySigmaSubtracted = sqrt(fabs(2.0*myLnLSubtracted));
01951       
01952       hLnL->SetBinContent( i+1, myLnLSubtracted );
01953       hSigma->SetBinContent( i+1, mySigmaSubtracted );
01954     }
01955 
01956     osc_hierarchy = hHierarchy->GetBinContent( ibest+1 );
01957     osc_dmsq      = hDmsq->GetBinContent( ibest+1 );
01958     osc_sinsq23   = hSinsq23->GetBinContent( ibest+1 );
01959     osc_sinsq13   = hSinsq13->GetBinContent( ibest+1 );
01960     osc_deltaCP   = hDeltaCP->GetBinContent( ibest+1 );
01961 
01962     output_dmsq   = osc_hierarchy*osc_dmsq;
01963 
01964     beam_numu_norm        = hBeamNumuNorm->GetBinContent( ibest+1 );
01965     beam_numu_ncbkg       = hBeamNumuNCBkg->GetBinContent( ibest+1 );
01966     beam_numu_shwen       = hBeamNumuShwEn->GetBinContent( ibest+1 );
01967     beam_numu_trken       = hBeamNumuTrkEn->GetBinContent( ibest+1 );
01968     beam_numu_trken_exit  = hBeamNumuTrkEnExit->GetBinContent( ibest+1 );
01969     beam_nue_norm         = hBeamNueNorm->GetBinContent( ibest+1 );
01970     beam_nue_ncbkg        = hBeamNueNCBkg->GetBinContent( ibest+1 );
01971     beam_nue_energy       = hBeamNueEnergy->GetBinContent( ibest+1 );
01972 
01973     atmos_norm_cv         = hAtmosNormCV->GetBinContent( ibest+1 );
01974     atmos_norm_rock       = hAtmosNormRock->GetBinContent( ibest+1 );
01975     atmos_chg_cv          = hAtmosChgCV->GetBinContent( ibest+1 );
01976     atmos_chg_rock        = hAtmosChgRock->GetBinContent( ibest+1 );
01977     atmos_nue_norm        = hAtmosNueNorm->GetBinContent( ibest+1 );
01978     atmos_nue_ratio       = hAtmosNueRatio->GetBinContent( ibest+1 );
01979     atmos_ncbkg           = hAtmosNCBkg->GetBinContent( ibest+1 );
01980     atmos_spec_cv_numu    = hAtmosSpecNumuCV->GetBinContent( ibest+1 );
01981     atmos_spec_cv_numubar = hAtmosSpecNumuBarCV->GetBinContent( ibest+1 ); 
01982     atmos_spec_cv_nue     = hAtmosSpecNueCV->GetBinContent( ibest+1 );
01983     atmos_spec_cv_nuebar  = hAtmosSpecNueBarCV->GetBinContent( ibest+1 ); 
01984     atmos_spec_rock_nu    = hAtmosSpecNuRock->GetBinContent( ibest+1 );
01985     atmos_spec_rock_nubar = hAtmosSpecNuBarRock->GetBinContent( ibest+1 );
01986     atmos_zenith          = hAtmosZenith->GetBinContent( ibest+1 );
01987     atmos_numu_trken      = hAtmosNumuTrkEn->GetBinContent( ibest+1 );
01988     atmos_numu_trken_exit = hAtmosNumuTrkEnExit->GetBinContent( ibest+1 );
01989     atmos_numu_shwen      = hAtmosNumuShwEn->GetBinContent( ibest+1 );
01990     atmos_nue_energy      = hAtmosNueEnergy->GetBinContent( ibest+1 );
01991 
01992     std::cout << " *** ThreeFlavourFitter::RunFit() *** " << std::endl;
01993     std::cout << "   OSC FIT RESULTS: " << std::endl;
01994 
01995     std::cout << "    seed parameters: " << std::endl;
01996     if( isNormal ) std::cout << "     osc_dmsq    = " << +fabs(fSeedDmsq) << std::endl;
01997     else           std::cout << "     osc_dmsq    = " << -fabs(fSeedDmsq) << std::endl;
01998     std::cout << "     osc_sinsq23 = " << fSeedSinsq23 << std::endl;
01999     std::cout << "     osc_sinsq13 = " << fSeedSinsq13 << std::endl;
02000     std::cout << "     osc_deltaCP = " << fSeedDeltaCP << std::endl;
02001     if( UsingBeamData() ){
02002       std::cout << "     beam_numu_norm        = " << fSeedBeamNumuNorm  << std::endl;
02003       std::cout << "     beam_numu_ncbkg       = " << fSeedBeamNumuNCBkg << std::endl;
02004       std::cout << "     beam_numu_shwen       = " << fSeedBeamNumuShwEn << std::endl;
02005       std::cout << "     beam_numu_trken       = " << fSeedBeamNumuTrkEn << std::endl;
02006       std::cout << "     beam_numu_trken_exit  = " << fSeedBeamNumuTrkEnExit << std::endl;
02007       std::cout << "     beam_nue_norm         = " << fSeedBeamNueNorm  << std::endl;
02008       std::cout << "     beam_nue_ncbkg        = " << fSeedBeamNueNCBkg << std::endl;
02009       std::cout << "     beam_nue_energy       = " << fSeedBeamNueEnergy << std::endl;
02010     }
02011     if( UsingAtmosData() ){
02012       std::cout << "     atmos_norm_cv         = " << fSeedAtmosNormCV << std::endl;
02013       std::cout << "     atmos_norm_rock       = " << fSeedAtmosNormRock << std::endl; 
02014       std::cout << "     atmos_chg_cv          = " << fSeedAtmosChgCV << std::endl;
02015       std::cout << "     atmos_chg_rock        = " << fSeedAtmosChgRock << std::endl; 
02016       std::cout << "     atmos_nue_norm        = " << fSeedAtmosNueNorm << std::endl;  
02017       std::cout << "     atmos_nue_ratio       = " << fSeedAtmosNueRatio << std::endl;       
02018       std::cout << "     atmos_ncbkg           = " << fSeedAtmosNCBkg << std::endl;
02019       std::cout << "     atmos_spec_cv_numu    = " << fSeedAtmosSpecNumuCV << std::endl;  
02020       std::cout << "     atmos_spec_cv_numubar = " << fSeedAtmosSpecNumuBarCV << std::endl; 
02021       std::cout << "     atmos_spec_cv_nue     = " << fSeedAtmosSpecNueCV << std::endl;  
02022       std::cout << "     atmos_spec_cv_nuebar  = " << fSeedAtmosSpecNueBarCV << std::endl;  
02023       std::cout << "     atmos_spec_rock_nu    = " << fSeedAtmosSpecNuRock << std::endl;  
02024       std::cout << "     atmos_spec_rock_nubar = " << fSeedAtmosSpecNuBarRock << std::endl; 
02025       std::cout << "     atmos_zenith          = " << fSeedAtmosZenith << std::endl;
02026       std::cout << "     atmos_numu_trken      = " << fSeedAtmosNumuTrkEn << std::endl;   
02027       std::cout << "     atmos_numu_trken_exit = " << fSeedAtmosNumuTrkEnExit << std::endl; 
02028       std::cout << "     atmos_numu_shwen      = " << fSeedAtmosNumuShwEn << std::endl;
02029       std::cout << "     atmos_nue_energy      = " << fSeedAtmosNueEnergy << std::endl;
02030     }
02031   }
02032   // Write Output Histograms
02033   // =======================
02034   if( 1 ){ // always write this file...
02035 
02036     TString filename = fOutFile;
02037     TString tag = ".output";
02038   
02039     if( filename.EndsWith(".root") )
02040       filename.Insert(filename.Length()-5,tag);
02041     else filename.Append(tag);
02042 
02043     std::cout << " *** ThreeFlavourFitter::WriteContours() *** " << std::endl;
02044     std::cout << "   Writing Likelihood Profile to File: " << filename.Data() << std::endl;
02045 
02046     TDirectory* tmpd = gDirectory;
02047     TFile* file = new TFile(filename.Data(),"recreate");
02048 
02049     hHierarchy->Write();
02050     hDmsq->Write(); 
02051     hSinsq23->Write();
02052     hSinsq13->Write();
02053     hDeltaCP->Write();
02054     hBeamNumuNorm->Write();
02055     hBeamNumuNCBkg->Write();
02056     hBeamNumuShwEn->Write();
02057     hBeamNumuTrkEn->Write();
02058     hBeamNumuTrkEnExit->Write();
02059     hBeamNueNorm->Write();
02060     hBeamNueNCBkg->Write();
02061     hBeamNueEnergy->Write();
02062     hAtmosNormCV->Write();
02063     hAtmosNormRock->Write();
02064     hAtmosChgCV->Write();
02065     hAtmosChgRock->Write();
02066     hAtmosNueNorm->Write();
02067     hAtmosNueRatio->Write();
02068     hAtmosNCBkg->Write();
02069     hAtmosSpecNumuCV->Write();
02070     hAtmosSpecNumuBarCV->Write(); 
02071     hAtmosSpecNueCV->Write();
02072     hAtmosSpecNueBarCV->Write();
02073     hAtmosSpecNuRock->Write();
02074     hAtmosSpecNuBarRock->Write();
02075     hAtmosZenith->Write();
02076     hAtmosNumuTrkEn->Write();
02077     hAtmosNumuTrkEnExit->Write();
02078     hAtmosNumuShwEn->Write();
02079     hAtmosNueEnergy->Write();
02080 
02081     hLnL->Write();
02082     hLnLTotal->Write();
02083     hSigma->Write();
02084 
02085     file->Close();
02086     tmpd->cd();
02087   }
02088 
02089   // retrieve saved parameters
02090   fInputDmsq    = saveInputDmsq;
02091   fInputDeltaCP = saveInputDeltaCP;
02092   fFitDeltaCP   = saveFitDeltaCP;
02093   fFixOctant    = saveFixOctant;
02094   fFitHierarchy = saveFitHierarchy;
02095 
02096   return;
02097 }

void ThreeFlavourFitter::CalcProfileSinsq23 ( Bool_t  isSensitivity = 1,
Bool_t  isNormal = 1,
Int_t  ifirst = -1,
Int_t  ilast = -1 
)

Definition at line 2099 of file ThreeFlavourFitter.cxx.

References BuildExpt(), fBigNumber, fFitSinsq23, fFixOctant, fInputDmsq, fInputSinsq23, fMockData, fOutFile, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, fSpecialSplitSinsq23, fSplitSinsq23, GetSinsq23(), GetSinsq23Bins(), GetSinsq23Max(), GetSinsq23Min(), PrintGrid(), PrintSettings(), RunFit(), TouchExpt(), UsingAtmosData(), and UsingBeamData().

02100 {
02101   std::cout << " *** ThreeFlavourFitter::CalcProfileSinsq23(...) *** " << std::endl;
02102 
02103   // Sanity Check
02104   // ============
02105   if( isSensitivity && !fMockData ){
02106     std::cout << "   <warning> isSensitivity=true, simulatedData=false " << std::endl
02107               << "             Wrong settings for sensitivity plots " << std::endl;
02108     assert(0);
02109   }
02110 
02111   if( GetSinsq23Bins()<=0 ){
02112     std::cout << "   <warning> No Sinsq23 grid " << std::endl;
02113     assert(0);
02114   }
02115 
02116   // Print Grid
02117   // ==========
02118   this->PrintGrid();
02119 
02120   // Print Settings
02121   // ==============
02122   this->PrintSettings();
02123 
02124   // Build Experiments
02125   // =================
02126   if( this->TouchExpt()==0 ){
02127     this->BuildExpt();
02128   }
02129 
02130   // Build Histograms
02131   // ================  
02132   // x-axis: Sinsq23
02133 
02134   Int_t nx = GetSinsq23Bins();
02135   Double_t xlow = GetSinsq23Min();
02136   Double_t xhigh = GetSinsq23Max();
02137   Double_t dx = (xhigh-xlow)/((double)nx-1.0);
02138   Double_t xmin = xlow  - 0.50*dx;
02139   Double_t xmax = xhigh + 0.50*dx;
02140   
02141   TH1D* hHierarchy = new TH1D("hHierarchy", "", nx,xmin,xmax);
02142   TH1D* hDmsq      = new TH1D("hDmsq",      "", nx,xmin,xmax);
02143   TH1D* hSinsq23   = new TH1D("hSinsq23",   "", nx,xmin,xmax);
02144   TH1D* hSinsq13   = new TH1D("hSinsq13",   "", nx,xmin,xmax);
02145   TH1D* hDeltaCP   = new TH1D("hDeltaCP",   "", nx,xmin,xmax);
02146 
02147   TH1D* hBeamNumuNorm  = new TH1D("hBeamNumuNorm", "", nx,xmin,xmax); 
02148   hBeamNumuNorm->GetYaxis()->SetTitle("Shift / #sigma");
02149   hBeamNumuNorm->GetXaxis()->SetTitle("sin^{2}#theta");
02150   hBeamNumuNorm->GetYaxis()->CenterTitle();
02151   hBeamNumuNorm->GetXaxis()->CenterTitle();
02152 
02153   TH1D* hBeamNumuNCBkg = new TH1D("hBeamNumuNCBkg","", nx,xmin,xmax);
02154   hBeamNumuNCBkg->GetYaxis()->SetTitle("Shift / #sigma");
02155   hBeamNumuNCBkg->GetXaxis()->SetTitle("sin^{2}#theta");
02156   hBeamNumuNCBkg->GetYaxis()->CenterTitle();
02157   hBeamNumuNCBkg->GetXaxis()->CenterTitle();
02158 
02159   TH1D* hBeamNumuShwEn = new TH1D("hBeamNumuShwEn","", nx,xmin,xmax);  
02160   hBeamNumuShwEn->GetYaxis()->SetTitle("Shift / #sigma");
02161   hBeamNumuShwEn->GetXaxis()->SetTitle("sin^{2}#theta");
02162   hBeamNumuShwEn->GetYaxis()->CenterTitle();
02163   hBeamNumuShwEn->GetXaxis()->CenterTitle();
02164 
02165   TH1D* hBeamNumuTrkEn = new TH1D("hBeamNumuTrkEn","", nx,xmin,xmax);
02166   hBeamNumuTrkEn->GetYaxis()->SetTitle("Shift / #sigma");
02167   hBeamNumuTrkEn->GetXaxis()->SetTitle("sin^{2}#theta");
02168   hBeamNumuTrkEn->GetYaxis()->CenterTitle();
02169   hBeamNumuTrkEn->GetXaxis()->CenterTitle();
02170 
02171   TH1D* hBeamNumuTrkEnExit = new TH1D("hBeamNumuTrkEnExit","", nx,xmin,xmax);
02172   hBeamNumuTrkEnExit->GetYaxis()->SetTitle("Shift / #sigma");
02173   hBeamNumuTrkEnExit->GetXaxis()->SetTitle("sin^{2}#theta");
02174   hBeamNumuTrkEnExit->GetYaxis()->CenterTitle();
02175   hBeamNumuTrkEnExit->GetXaxis()->CenterTitle();
02176 
02177   TH1D* hBeamNueNorm  = new TH1D("hBeamNueNorm", "", nx,xmin,xmax); 
02178   hBeamNueNorm->GetYaxis()->SetTitle("Shift / #sigma");
02179   hBeamNueNorm->GetXaxis()->SetTitle("sin^{2}#theta");
02180   hBeamNueNorm->GetYaxis()->CenterTitle();
02181   hBeamNueNorm->GetXaxis()->CenterTitle();
02182 
02183   TH1D* hBeamNueNCBkg = new TH1D("hBeamNueNCBkg","", nx,xmin,xmax);
02184   hBeamNueNCBkg->GetYaxis()->SetTitle("Shift / #sigma");
02185   hBeamNueNCBkg->GetXaxis()->SetTitle("sin^{2}#theta");
02186   hBeamNueNCBkg->GetYaxis()->CenterTitle();
02187   hBeamNueNCBkg->GetXaxis()->CenterTitle();
02188 
02189   TH1D* hBeamNueEnergy = new TH1D("hBeamNueEnergy","", nx,xmin,xmax);  
02190   hBeamNueEnergy->GetYaxis()->SetTitle("Shift / #sigma");
02191   hBeamNueEnergy->GetXaxis()->SetTitle("sin^{2}#theta");
02192   hBeamNueEnergy->GetYaxis()->CenterTitle();
02193   hBeamNueEnergy->GetXaxis()->CenterTitle();
02194 
02195   TH1D* hAtmosNormCV = new TH1D("hAtmosNormCV","", nx,xmin,xmax);
02196   hAtmosNormCV->GetYaxis()->SetTitle("Shift / #sigma");
02197   hAtmosNormCV->GetXaxis()->SetTitle("sin^{2}#theta");
02198   hAtmosNormCV->GetYaxis()->CenterTitle();
02199   hAtmosNormCV->GetXaxis()->CenterTitle();
02200 
02201   TH1D* hAtmosNormRock = new TH1D("hAtmosNormRock","", nx,xmin,xmax);
02202   hAtmosNormRock->GetYaxis()->SetTitle("Shift / #sigma");
02203   hAtmosNormRock->GetXaxis()->SetTitle("sin^{2}#theta");
02204   hAtmosNormRock->GetYaxis()->CenterTitle();
02205   hAtmosNormRock->GetXaxis()->CenterTitle();
02206 
02207   TH1D* hAtmosChgCV = new TH1D("hAtmosChgCV","", nx,xmin,xmax);
02208   hAtmosChgCV->GetYaxis()->SetTitle("Shift / #sigma");
02209   hAtmosChgCV->GetXaxis()->SetTitle("sin^{2}#theta");
02210   hAtmosChgCV->GetYaxis()->CenterTitle();
02211   hAtmosChgCV->GetXaxis()->CenterTitle();
02212 
02213   TH1D* hAtmosChgRock = new TH1D("hAtmosChgRock","", nx,xmin,xmax);
02214   hAtmosChgRock->GetYaxis()->SetTitle("Shift / #sigma");
02215   hAtmosChgRock->GetXaxis()->SetTitle("sin^{2}#theta");
02216   hAtmosChgRock->GetYaxis()->CenterTitle();
02217   hAtmosChgRock->GetXaxis()->CenterTitle();
02218 
02219   TH1D* hAtmosNueNorm = new TH1D("hAtmosNueNorm","", nx,xmin,xmax);
02220   hAtmosNueNorm->GetYaxis()->SetTitle("Shift / #sigma");
02221   hAtmosNueNorm->GetXaxis()->SetTitle("sin^{2}#theta");
02222   hAtmosNueNorm->GetYaxis()->CenterTitle();
02223   hAtmosNueNorm->GetXaxis()->CenterTitle();
02224 
02225   TH1D* hAtmosNueRatio = new TH1D("hAtmosNueRatio","", nx,xmin,xmax);
02226   hAtmosNueRatio->GetYaxis()->SetTitle("Shift / #sigma");
02227   hAtmosNueRatio->GetXaxis()->SetTitle("sin^{2}#theta");
02228   hAtmosNueRatio->GetYaxis()->CenterTitle();
02229   hAtmosNueRatio->GetXaxis()->CenterTitle();
02230 
02231   TH1D* hAtmosNCBkg = new TH1D("hAtmosNCBkg","", nx,xmin,xmax);
02232   hAtmosNCBkg->GetYaxis()->SetTitle("Shift / #sigma");
02233   hAtmosNCBkg->GetXaxis()->SetTitle("sin^{2}#theta");
02234   hAtmosNCBkg->GetYaxis()->CenterTitle();
02235   hAtmosNCBkg->GetXaxis()->CenterTitle();
02236 
02237   TH1D* hAtmosSpecNumuCV = new TH1D("hAtmosSpecNumuCV","", nx,xmin,xmax);
02238   hAtmosSpecNumuCV->GetYaxis()->SetTitle("Shift / #sigma");
02239   hAtmosSpecNumuCV->GetXaxis()->SetTitle("sin^{2}#theta");
02240   hAtmosSpecNumuCV->GetYaxis()->CenterTitle();
02241   hAtmosSpecNumuCV->GetXaxis()->CenterTitle();
02242 
02243   TH1D* hAtmosSpecNumuBarCV = new TH1D("hAtmosSpecNumuBarCV","", nx,xmin,xmax);
02244   hAtmosSpecNumuBarCV->GetYaxis()->SetTitle("Shift / #sigma");
02245   hAtmosSpecNumuBarCV->GetXaxis()->SetTitle("sin^{2}#theta");
02246   hAtmosSpecNumuBarCV->GetYaxis()->CenterTitle();
02247   hAtmosSpecNumuBarCV->GetXaxis()->CenterTitle(); 
02248 
02249   TH1D* hAtmosSpecNueCV = new TH1D("hAtmosSpecNueCV","", nx,xmin,xmax);
02250   hAtmosSpecNueCV->GetYaxis()->SetTitle("Shift / #sigma");
02251   hAtmosSpecNueCV->GetXaxis()->SetTitle("sin^{2}#theta");
02252   hAtmosSpecNueCV->GetYaxis()->CenterTitle();
02253   hAtmosSpecNueCV->GetXaxis()->CenterTitle();
02254 
02255   TH1D* hAtmosSpecNueBarCV = new TH1D("hAtmosSpecNueBarCV","", nx,xmin,xmax);
02256   hAtmosSpecNueBarCV->GetYaxis()->SetTitle("Shift / #sigma");
02257   hAtmosSpecNueBarCV->GetXaxis()->SetTitle("sin^{2}#theta");
02258   hAtmosSpecNueBarCV->GetYaxis()->CenterTitle();
02259   hAtmosSpecNueBarCV->GetXaxis()->CenterTitle(); 
02260   
02261   TH1D* hAtmosSpecNuRock = new TH1D("hAtmosSpecNuRock","", nx,xmin,xmax);
02262   hAtmosSpecNuRock->GetYaxis()->SetTitle("Shift / #sigma");
02263   hAtmosSpecNuRock->GetXaxis()->SetTitle("sin^{2}#theta");
02264   hAtmosSpecNuRock->GetYaxis()->CenterTitle();
02265   hAtmosSpecNuRock->GetXaxis()->CenterTitle();
02266 
02267   TH1D* hAtmosSpecNuBarRock = new TH1D("hAtmosSpecNuBarRock","", nx,xmin,xmax);
02268   hAtmosSpecNuBarRock->GetYaxis()->SetTitle("Shift / #sigma");
02269   hAtmosSpecNuBarRock->GetXaxis()->SetTitle("sin^{2}#theta");
02270   hAtmosSpecNuBarRock->GetYaxis()->CenterTitle();
02271   hAtmosSpecNuBarRock->GetXaxis()->CenterTitle();
02272 
02273   TH1D* hAtmosZenith = new TH1D("hAtmosZenith","", nx,xmin,xmax);
02274   hAtmosZenith->GetYaxis()->SetTitle("Shift / #sigma");
02275   hAtmosZenith->GetXaxis()->SetTitle("sin^{2}#theta");
02276   hAtmosZenith->GetYaxis()->CenterTitle();
02277   hAtmosZenith->GetXaxis()->CenterTitle();
02278 
02279   TH1D* hAtmosNumuTrkEn = new TH1D("hAtmosNumuTrkEn","", nx,xmin,xmax);
02280   hAtmosNumuTrkEn->GetYaxis()->SetTitle("Shift / #sigma");
02281   hAtmosNumuTrkEn->GetXaxis()->SetTitle("sin^{2}#theta");
02282   hAtmosNumuTrkEn->GetYaxis()->CenterTitle();
02283   hAtmosNumuTrkEn->GetXaxis()->CenterTitle();
02284 
02285   TH1D* hAtmosNumuTrkEnExit = new TH1D("hAtmosNumuTrkEnExit","", nx,xmin,xmax);
02286   hAtmosNumuTrkEnExit->GetYaxis()->SetTitle("Shift / #sigma");
02287   hAtmosNumuTrkEnExit->GetXaxis()->SetTitle("sin^{2}#theta");
02288   hAtmosNumuTrkEnExit->GetYaxis()->CenterTitle();
02289   hAtmosNumuTrkEnExit->GetXaxis()->CenterTitle();
02290 
02291   TH1D* hAtmosNumuShwEn = new TH1D("hAtmosNumuShwEn","", nx,xmin,xmax);
02292   hAtmosNumuShwEn->GetYaxis()->SetTitle("Shift / #sigma");
02293   hAtmosNumuShwEn->GetXaxis()->SetTitle("sin^{2}#theta");
02294   hAtmosNumuShwEn->GetYaxis()->CenterTitle();
02295   hAtmosNumuShwEn->GetXaxis()->CenterTitle();
02296 
02297   TH1D* hAtmosNueEnergy = new TH1D("hAtmosNueEnergy","", nx,xmin,xmax);
02298   hAtmosNueEnergy->GetYaxis()->SetTitle("Shift / #sigma");
02299   hAtmosNueEnergy->GetXaxis()->SetTitle("sin^{2}#theta");
02300   hAtmosNueEnergy->GetYaxis()->CenterTitle();
02301   hAtmosNueEnergy->GetXaxis()->CenterTitle();
02302 
02303   TH1D* hLnLTotal = new TH1D("hLnLTotal", "", nx,xmin,xmax);
02304   hLnLTotal->GetYaxis()->SetTitle("#DeltaLog(L)");
02305   hLnLTotal->GetXaxis()->SetTitle("sin^{2}#theta");
02306   hLnLTotal->GetYaxis()->CenterTitle();
02307   hLnLTotal->GetXaxis()->CenterTitle();
02308 
02309   TH1D* hLnL = new TH1D("hLnL", "", nx,xmin,xmax);
02310   hLnL->GetYaxis()->SetTitle("#DeltaLog(L)");
02311   hLnL->GetXaxis()->SetTitle("sin^{2}#theta");
02312   hLnL->GetYaxis()->CenterTitle();
02313   hLnL->GetXaxis()->CenterTitle();
02314 
02315   TH1D* hSigma = new TH1D("hLnLSigma", "", nx,xmin,xmax);
02316   hSigma->GetYaxis()->SetTitle("Standard Deviations");
02317   hSigma->GetXaxis()->SetTitle("sin^{2}#theta");
02318   hSigma->GetYaxis()->CenterTitle();
02319   hSigma->GetXaxis()->CenterTitle();
02320 
02321   //
02322   // Print Binning
02323   // -------------
02324   //
02325   // std::cout << " --- sinsq23 --- " << std::endl;
02326   // for( Int_t n=0; n<hLnL->GetXaxis()->GetNbins(); n++ ){
02327   //   std::cout << " [" << n << "] " << hLnL->GetXaxis()->GetBinCenter(n+1) << std::endl;
02328   // }
02329   //
02330 
02331  
02332   // Run Oscillation Fit
02333   // ==================
02334   Double_t input_dmsq    = 0.0;
02335   Double_t input_sinsq23 = 0.0;
02336   Double_t input_sinsq13 = 0.0;
02337   Double_t input_deltaCP = 0.0;
02338   
02339   Double_t osc_hierarchy         = 0.0;
02340   Double_t osc_dmsq              = 0.0;
02341   Double_t osc_sinsq23           = 0.0;
02342   Double_t osc_sinsq13           = 0.0;
02343   Double_t osc_deltaCP           = 0.0;
02344   Double_t beam_numu_norm        = 0.0;
02345   Double_t beam_numu_ncbkg       = 0.0;
02346   Double_t beam_numu_shwen       = 0.0;
02347   Double_t beam_numu_trken       = 0.0;
02348   Double_t beam_numu_trken_exit  = 0.0;
02349   Double_t beam_nue_norm         = 0.0;
02350   Double_t beam_nue_ncbkg        = 0.0;
02351   Double_t beam_nue_energy       = 0.0;
02352   Double_t atmos_norm_cv         = 0.0;
02353   Double_t atmos_norm_rock       = 0.0;
02354   Double_t atmos_chg_cv          = 0.0;
02355   Double_t atmos_chg_rock        = 0.0;
02356   Double_t atmos_nue_norm        = 0.0;
02357   Double_t atmos_nue_ratio       = 0.0;
02358   Double_t atmos_ncbkg           = 0.0;
02359   Double_t atmos_spec_cv_numu    = 0.0;
02360   Double_t atmos_spec_cv_numubar = 0.0; 
02361   Double_t atmos_spec_cv_nue     = 0.0;
02362   Double_t atmos_spec_cv_nuebar  = 0.0; 
02363   Double_t atmos_spec_rock_nu    = 0.0;
02364   Double_t atmos_spec_rock_nubar = 0.0;
02365   Double_t atmos_zenith          = 0.0;
02366   Double_t atmos_numu_trken      = 0.0;
02367   Double_t atmos_numu_trken_exit = 0.0;
02368   Double_t atmos_numu_shwen      = 0.0;
02369   Double_t atmos_nue_energy      = 0.0;
02370 
02371   Double_t output_dmsq      = 0.0;
02372 
02373   Double_t LnL = 0.0; 
02374   Double_t minLnL = fBigNumber;
02375 
02376   Double_t saveInputDmsq    = fInputDmsq;
02377   Double_t saveInputSinsq23 = fInputSinsq23;
02378   Double_t saveSeedSinsq23  = fSeedSinsq23;
02379   Bool_t   saveSplitSinsq23 = fSplitSinsq23;
02380   Bool_t   saveFitSinsq23   = fFitSinsq23;
02381   Bool_t   saveFixOctant    = fFixOctant;
02382 
02383   Bool_t saveSpecialSplitSinsq23 = fSpecialSplitSinsq23;
02384 
02385   Int_t ibest = -1;
02386   Int_t first = ifirst;
02387   Int_t last  = ilast;
02388 
02389   if( first<0 ) first = 0;
02390   if( last<0 )  last  = GetSinsq23Bins();
02391   if( last>GetSinsq23Bins() ) last = GetSinsq23Bins();
02392 
02393   // Print Warning Message
02394   if( isSensitivity ){
02395     if( ( isNormal==true  && saveInputDmsq<0 )
02396      || ( isNormal==false && saveInputDmsq>0 ) ){
02397       std::cout << "   <warning> overriding input oscillations: sign(dm2) will change " << std::endl;
02398     }
02399   }
02400 
02401   // Loop over Sinsq23 Bins (x-axis)
02402   std::cout << " *** RunFit [FirstBin=" << first << ", LastBin=" << last << "] *** " << std::endl;
02403   for( Int_t i=first; i<last; i++ ){          
02404     std::cout << " ---- RunFit: [" << i << "] ---- " << std::endl;
02405 
02406     // Seed Parameters
02407     input_dmsq    = fabs(fSeedDmsq); 
02408     input_sinsq23 = GetSinsq23( i );
02409     input_sinsq13 = fSeedSinsq13;
02410     input_deltaCP = fSeedDeltaCP;    
02411     
02412     if( isNormal==0 ) input_dmsq = -input_dmsq;
02413 
02414     // Generate New Experiment
02415     if( isSensitivity ){
02416       fInputDmsq    = fabs(saveInputDmsq);
02417       fInputSinsq23 = input_sinsq23;
02418 
02419       if( isNormal==0 ) fInputDmsq = -fInputDmsq;
02420     
02421       BuildExpt();
02422     }
02423 
02424     // Fit Opposite Octant
02425     if( isSensitivity ){ 
02426       // fSeedSinsq23  = 1.0 - GetSinsq23( i );
02427            if( GetSinsq23(i)<0.5 ) fSeedSinsq23 = GetSinsq23Max();
02428       else if( GetSinsq23(i)>0.5 ) fSeedSinsq23 = GetSinsq23Min();
02429       else                         fSeedSinsq23 = 0.5;
02430 
02431       fSplitSinsq23 = true;
02432       fFitSinsq23   = true;
02433       fFixOctant    = true;
02434 
02435       if( GetSinsq23(i)<0.5 ) fSpecialSplitSinsq23 = true;
02436       else                    fSpecialSplitSinsq23 = false;
02437     }
02438 
02439     // Fit Sinsq23 Parameter 
02440     if( fFitSinsq23 ) input_sinsq23 = fSeedSinsq23;
02441 
02442     // Run Fit
02443     this->RunFit( input_dmsq,         input_sinsq23,
02444                   input_sinsq13,      input_deltaCP,
02445                   osc_dmsq,           osc_sinsq23,
02446                   osc_sinsq13,        osc_deltaCP,    
02447                   beam_numu_norm,     beam_numu_ncbkg,
02448                   beam_numu_shwen,    beam_numu_trken,
02449                   beam_numu_trken_exit,
02450                   beam_nue_norm,      beam_nue_ncbkg,
02451                   beam_nue_energy, 
02452                   atmos_norm_cv,      atmos_norm_rock, 
02453                   atmos_chg_cv,       atmos_chg_rock, 
02454                   atmos_nue_norm,     atmos_nue_ratio,       
02455                   atmos_ncbkg,
02456                   atmos_spec_cv_numu, atmos_spec_cv_numubar,
02457                   atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
02458                   atmos_spec_rock_nu, atmos_spec_rock_nubar,
02459                   atmos_zenith,
02460                   atmos_numu_trken,   atmos_numu_trken_exit,
02461                   atmos_numu_shwen,   atmos_nue_energy,
02462                   LnL );
02463 
02464     if( osc_dmsq>=0.0 ) osc_hierarchy = +1.0;
02465     else                osc_hierarchy = -1.0;
02466 
02467     hHierarchy->SetBinContent( i+1, osc_hierarchy );
02468     hDmsq->SetBinContent( i+1, fabs(osc_dmsq) );
02469     hSinsq23->SetBinContent( i+1, osc_sinsq23 );
02470     hSinsq13->SetBinContent( i+1, osc_sinsq13 );
02471     hDeltaCP->SetBinContent( i+1, osc_deltaCP );
02472 
02473     hBeamNumuNorm->SetBinContent( i+1, beam_numu_norm );
02474     hBeamNumuNCBkg->SetBinContent( i+1, beam_numu_ncbkg );
02475     hBeamNumuShwEn->SetBinContent( i+1, beam_numu_shwen );
02476     hBeamNumuTrkEn->SetBinContent( i+1, beam_numu_trken );
02477     hBeamNumuTrkEnExit->SetBinContent( i+1, beam_numu_trken_exit );
02478     hBeamNueNorm->SetBinContent( i+1, beam_nue_norm );
02479     hBeamNueNCBkg->SetBinContent( i+1, beam_nue_ncbkg );
02480     hBeamNueEnergy->SetBinContent( i+1, beam_nue_energy );
02481 
02482     hAtmosNormCV->SetBinContent( i+1, atmos_norm_cv );
02483     hAtmosNormRock->SetBinContent( i+1, atmos_norm_rock );
02484     hAtmosChgCV->SetBinContent( i+1,atmos_chg_cv );
02485     hAtmosChgRock->SetBinContent( i+1,atmos_chg_rock );
02486     hAtmosNueNorm->SetBinContent( i+1, atmos_nue_norm );
02487     hAtmosNueRatio->SetBinContent( i+1, atmos_nue_ratio );
02488     hAtmosNCBkg->SetBinContent( i+1, atmos_ncbkg );
02489     hAtmosSpecNumuCV->SetBinContent( i+1, atmos_spec_cv_numu );
02490     hAtmosSpecNumuBarCV->SetBinContent( i+1, atmos_spec_cv_numubar );
02491     hAtmosSpecNueCV->SetBinContent( i+1, atmos_spec_cv_nue );
02492     hAtmosSpecNueBarCV->SetBinContent( i+1, atmos_spec_cv_nuebar );
02493     hAtmosSpecNuRock->SetBinContent( i+1, atmos_spec_rock_nu );
02494     hAtmosSpecNuBarRock->SetBinContent( i+1, atmos_spec_rock_nubar );
02495     hAtmosZenith->SetBinContent( i+1, atmos_zenith );
02496     hAtmosNumuTrkEn->SetBinContent( i+1, atmos_numu_trken );
02497     hAtmosNumuTrkEnExit->SetBinContent( i+1, atmos_numu_trken_exit );
02498     hAtmosNumuShwEn->SetBinContent( i+1, atmos_numu_shwen );
02499     hAtmosNueEnergy->SetBinContent( i+1, atmos_nue_energy );
02500 
02501     hLnL->SetBinContent( i+1, LnL );
02502     hLnLTotal->SetBinContent( i+1, LnL );
02503 
02504     // Best Fit
02505     if( LnL<minLnL ){
02506       ibest = i; 
02507       minLnL = LnL;
02508     }
02509   }
02510 
02511   
02512   // Best Fit Oscillations
02513   // =====================
02514   if( ibest>=0 ){
02515  
02516     for( Int_t i=0; i<hLnL->GetXaxis()->GetNbins(); i++ ){
02517       Double_t myLnL = hLnL->GetBinContent( i+1 ); 
02518       Double_t myLnLSubtracted = myLnL;
02519     
02520       if( isSensitivity==false 
02521        && myLnL>0 && minLnL<=myLnL ) myLnLSubtracted = myLnL - minLnL;
02522 
02523       Double_t mySigmaSubtracted = sqrt(fabs(2.0*myLnLSubtracted));
02524       
02525       hLnL->SetBinContent( i+1, myLnLSubtracted );
02526       hSigma->SetBinContent( i+1, mySigmaSubtracted );
02527     }
02528 
02529     osc_hierarchy = hHierarchy->GetBinContent( ibest+1 );
02530     osc_dmsq      = hDmsq->GetBinContent( ibest+1 );
02531     osc_sinsq23   = hSinsq23->GetBinContent( ibest+1 );
02532     osc_sinsq13   = hSinsq13->GetBinContent( ibest+1 );
02533     osc_deltaCP   = hDeltaCP->GetBinContent( ibest+1 );
02534 
02535     output_dmsq   = osc_hierarchy*osc_dmsq;
02536 
02537     beam_numu_norm        = hBeamNumuNorm->GetBinContent( ibest+1 );
02538     beam_numu_ncbkg       = hBeamNumuNCBkg->GetBinContent( ibest+1 );
02539     beam_numu_shwen       = hBeamNumuShwEn->GetBinContent( ibest+1 );
02540     beam_numu_trken       = hBeamNumuTrkEn->GetBinContent( ibest+1 );
02541     beam_numu_trken_exit  = hBeamNumuTrkEnExit->GetBinContent( ibest+1 );
02542     beam_nue_norm         = hBeamNueNorm->GetBinContent( ibest+1 );
02543     beam_nue_ncbkg        = hBeamNueNCBkg->GetBinContent( ibest+1 );
02544     beam_nue_energy       = hBeamNueEnergy->GetBinContent( ibest+1 );
02545 
02546     atmos_norm_cv         = hAtmosNormCV->GetBinContent( ibest+1 );
02547     atmos_norm_rock       = hAtmosNormRock->GetBinContent( ibest+1 );
02548     atmos_chg_cv          = hAtmosChgCV->GetBinContent( ibest+1 );
02549     atmos_chg_rock        = hAtmosChgRock->GetBinContent( ibest+1 );
02550     atmos_nue_norm        = hAtmosNueNorm->GetBinContent( ibest+1 );
02551     atmos_nue_ratio       = hAtmosNueRatio->GetBinContent( ibest+1 );
02552     atmos_ncbkg           = hAtmosNCBkg->GetBinContent( ibest+1 );
02553     atmos_spec_cv_numu    = hAtmosSpecNumuCV->GetBinContent( ibest+1 );
02554     atmos_spec_cv_numubar = hAtmosSpecNumuBarCV->GetBinContent( ibest+1 ); 
02555     atmos_spec_cv_nue     = hAtmosSpecNueCV->GetBinContent( ibest+1 );
02556     atmos_spec_cv_nuebar  = hAtmosSpecNueBarCV->GetBinContent( ibest+1 ); 
02557     atmos_spec_rock_nu    = hAtmosSpecNuRock->GetBinContent( ibest+1 );
02558     atmos_spec_rock_nubar = hAtmosSpecNuBarRock->GetBinContent( ibest+1 );
02559     atmos_zenith          = hAtmosZenith->GetBinContent( ibest+1 );
02560     atmos_numu_trken      = hAtmosNumuTrkEn->GetBinContent( ibest+1 );
02561     atmos_numu_trken_exit = hAtmosNumuTrkEnExit->GetBinContent( ibest+1 );
02562     atmos_numu_shwen      = hAtmosNumuShwEn->GetBinContent( ibest+1 );
02563     atmos_nue_energy      = hAtmosNueEnergy->GetBinContent( ibest+1 );
02564 
02565     std::cout << " *** ThreeFlavourFitter::RunFit() *** " << std::endl;
02566     std::cout << "   OSC FIT RESULTS: " << std::endl;
02567 
02568     std::cout << "    seed parameters: " << std::endl;
02569     if( isNormal ) std::cout << "     osc_dmsq    = " << +fabs(fSeedDmsq) << std::endl;
02570     else           std::cout << "     osc_dmsq    = " << -fabs(fSeedDmsq) << std::endl;
02571     std::cout << "     osc_sinsq23 = " << fSeedSinsq23 << std::endl;
02572     std::cout << "     osc_sinsq13 = " << fSeedSinsq13 << std::endl;
02573     std::cout << "     osc_deltaCP = " << fSeedDeltaCP << std::endl;
02574     if( UsingBeamData() ){
02575       std::cout << "     beam_numu_norm        = " << fSeedBeamNumuNorm  << std::endl;
02576       std::cout << "     beam_numu_ncbkg       = " << fSeedBeamNumuNCBkg << std::endl;
02577       std::cout << "     beam_numu_shwen       = " << fSeedBeamNumuShwEn << std::endl;
02578       std::cout << "     beam_numu_trken       = " << fSeedBeamNumuTrkEn << std::endl;
02579       std::cout << "     beam_numu_trken_exit  = " << fSeedBeamNumuTrkEnExit << std::endl;
02580       std::cout << "     beam_nue_norm         = " << fSeedBeamNueNorm  << std::endl;
02581       std::cout << "     beam_nue_ncbkg        = " << fSeedBeamNueNCBkg << std::endl;
02582       std::cout << "     beam_nue_energy       = " << fSeedBeamNueEnergy << std::endl;
02583     }
02584     if( UsingAtmosData() ){
02585       std::cout << "     atmos_norm_cv         = " << fSeedAtmosNormCV << std::endl;
02586       std::cout << "     atmos_norm_rock       = " << fSeedAtmosNormRock << std::endl; 
02587       std::cout << "     atmos_chg_cv          = " << fSeedAtmosChgCV << std::endl;
02588       std::cout << "     atmos_chg_rock        = " << fSeedAtmosChgRock << std::endl; 
02589       std::cout << "     atmos_nue_norm        = " << fSeedAtmosNueNorm << std::endl;   
02590       std::cout << "     atmos_nue_ratio       = " << fSeedAtmosNueRatio << std::endl;      
02591       std::cout << "     atmos_ncbkg           = " << fSeedAtmosNCBkg << std::endl;
02592       std::cout << "     atmos_spec_cv_numu    = " << fSeedAtmosSpecNumuCV << std::endl;  
02593       std::cout << "     atmos_spec_cv_numubar = " << fSeedAtmosSpecNumuBarCV << std::endl;  
02594       std::cout << "     atmos_spec_cv_nue     = " << fSeedAtmosSpecNueCV << std::endl;  
02595       std::cout << "     atmos_spec_cv_nuebar  = " << fSeedAtmosSpecNueBarCV << std::endl; 
02596       std::cout << "     atmos_spec_rock_nu    = " << fSeedAtmosSpecNuRock << std::endl;  
02597       std::cout << "     atmos_spec_rock_nubar = " << fSeedAtmosSpecNuBarRock << std::endl; 
02598       std::cout << "     atmos_zenith          = " << fSeedAtmosZenith << std::endl;
02599       std::cout << "     atmos_numu_trken      = " << fSeedAtmosNumuTrkEn << std::endl;   
02600       std::cout << "     atmos_numu_trken_exit = " << fSeedAtmosNumuTrkEnExit << std::endl; 
02601       std::cout << "     atmos_numu_shwen      = " << fSeedAtmosNumuShwEn << std::endl;
02602       std::cout << "     atmos_nue_energy      = " << fSeedAtmosNueEnergy << std::endl;
02603     }
02604 
02605     std::cout << "    best fit parameters: " << std::endl; 
02606     std::cout << "     osc_dmsq    = " << output_dmsq << std::endl;
02607     std::cout << "     osc_sinsq23 = " << osc_sinsq23 << std::endl;
02608     std::cout << "     osc_sinsq13 = " << osc_sinsq13 << std::endl;
02609     std::cout << "     osc_deltaCP = " << osc_deltaCP << std::endl;
02610     if( UsingBeamData() ){
02611       std::cout << "     beam_numu_norm        = " << beam_numu_norm << std::endl;
02612       std::cout << "     beam_numu_ncbkg       = " << beam_numu_ncbkg << std::endl;
02613       std::cout << "     beam_numu_shwen       = " << beam_numu_shwen << std::endl;
02614       std::cout << "     beam_numu_trken       = " << beam_numu_trken << std::endl; 
02615       std::cout << "     beam_numu_trken_exit  = " << beam_numu_trken_exit << std::endl; 
02616       std::cout << "     beam_nue_norm         = " << beam_nue_norm << std::endl;
02617       std::cout << "     beam_nue_ncbkg        = " << beam_nue_ncbkg << std::endl;
02618       std::cout << "     beam_nue_energy       = " << beam_nue_energy << std::endl;
02619     }
02620     if( UsingAtmosData() ){
02621       std::cout << "     atmos_norm_cv         = " << atmos_norm_cv << std::endl;
02622       std::cout << "     atmos_norm_rock       = " << atmos_norm_rock << std::endl; 
02623       std::cout << "     atmos_chg_cv          = " << atmos_chg_cv << std::endl;
02624       std::cout << "     atmos_chg_rock        = " << atmos_chg_rock << std::endl;
02625       std::cout << "     atmos_nue_norm        = " << atmos_nue_norm << std::endl;
02626       std::cout << "     atmos_nue_ratio       = " << atmos_nue_ratio << std::endl;
02627       std::cout << "     atmos_ncbkg           = " << atmos_ncbkg << std::endl;
02628       std::cout << "     atmos_spec_cv_numu    = " << atmos_spec_cv_numu << std::endl;
02629       std::cout << "     atmos_spec_cv_numubar = " << atmos_spec_cv_numubar << std::endl;
02630       std::cout << "     atmos_spec_cv_nue     = " << atmos_spec_cv_nue << std::endl;
02631       std::cout << "     atmos_spec_cv_nuebar  = " << atmos_spec_cv_nuebar << std::endl;
02632       std::cout << "     atmos_spec_rock_nu    = " << atmos_spec_rock_nu << std::endl;
02633       std::cout << "     atmos_spec_rock_nubar = " << atmos_spec_rock_nubar << std::endl;
02634       std::cout << "     atmos_zenith          = " << atmos_zenith << std::endl;
02635       std::cout << "     atmos_numu_trken      = " << atmos_numu_trken << std::endl;
02636       std::cout << "     atmos_numu_trken_exit = " << atmos_numu_trken_exit << std::endl;
02637       std::cout << "     atmos_numu_shwen      = " << atmos_numu_shwen << std::endl;      
02638       std::cout << "     atmos_nue_energy      = " << atmos_nue_energy << std::endl;
02639     }
02640 
02641     std::cout << "    goodness of fit: " << std::endl;
02642     std::cout << "     LnLbest=" << minLnL << std::endl;   
02643   }
02644 
02645 
02646   // Write Output Histograms
02647   // =======================
02648   if( 1 ){ // always write this file...
02649 
02650     TString filename = fOutFile;
02651     TString tag = ".output";
02652   
02653     if( filename.EndsWith(".root") )
02654       filename.Insert(filename.Length()-5,tag);
02655     else filename.Append(tag);
02656 
02657     std::cout << " *** ThreeFlavourFitter::WriteContours() *** " << std::endl;
02658     std::cout << "   Writing likelihood Profile to File: " << filename.Data() << std::endl;
02659 
02660     TDirectory* tmpd = gDirectory;
02661     TFile* file = new TFile(filename.Data(),"recreate");
02662 
02663     hHierarchy->Write();
02664     hDmsq->Write(); 
02665     hSinsq23->Write();
02666     hSinsq13->Write();
02667     hDeltaCP->Write();
02668     hBeamNumuNorm->Write();
02669     hBeamNumuNCBkg->Write();
02670     hBeamNumuShwEn->Write();
02671     hBeamNumuTrkEn->Write();
02672     hBeamNumuTrkEnExit->Write();
02673     hBeamNueNorm->Write();
02674     hBeamNueNCBkg->Write();
02675     hBeamNueEnergy->Write();
02676     hAtmosNormCV->Write();
02677     hAtmosNormRock->Write();
02678     hAtmosChgCV->Write();
02679     hAtmosChgRock->Write();
02680     hAtmosNueNorm->Write();
02681     hAtmosNueRatio->Write();
02682     hAtmosNCBkg->Write();
02683     hAtmosSpecNumuCV->Write();
02684     hAtmosSpecNumuBarCV->Write();
02685     hAtmosSpecNueCV->Write();
02686     hAtmosSpecNueBarCV->Write();
02687     hAtmosSpecNuRock->Write();
02688     hAtmosSpecNuBarRock->Write();
02689     hAtmosZenith->Write();
02690     hAtmosNumuTrkEn->Write();
02691     hAtmosNumuTrkEnExit->Write();
02692     hAtmosNumuShwEn->Write();
02693     hAtmosNueEnergy->Write();
02694 
02695     hLnL->Write();
02696     hLnLTotal->Write();
02697     hSigma->Write();
02698 
02699     file->Close();
02700     tmpd->cd();
02701   }
02702 
02703   // retrieve saved parameters
02704   fInputDmsq    = saveInputDmsq;
02705   fInputSinsq23 = saveInputSinsq23;
02706   fSeedSinsq23  = saveSeedSinsq23;
02707   fSplitSinsq23 = saveSplitSinsq23;
02708   fFitSinsq23   = saveFitSinsq23;
02709   fFixOctant    = saveFixOctant;
02710   
02711   fSpecialSplitSinsq23 = saveSpecialSplitSinsq23;
02712 
02713   return;
02714 }

Bool_t OscFit::ThreeFlavourFitter::Debugging (  )  [inline]

Definition at line 509 of file ThreeFlavourFitter.h.

References fDebug.

00509 {return fDebug;}

void OscFit::ThreeFlavourFitter::FitAtmosChgCV ( Bool_t  fitme = true  )  [inline]

Definition at line 413 of file ThreeFlavourFitter.h.

References fFitAtmosChgCV.

00414     {
00415       fFitAtmosChgCV = fitme;
00416     }

void OscFit::ThreeFlavourFitter::FitAtmosChgRock ( Bool_t  fitme = true  )  [inline]

Definition at line 418 of file ThreeFlavourFitter.h.

References fFitAtmosChgRock.

00419     {
00420       fFitAtmosChgRock = fitme;
00421     }

void OscFit::ThreeFlavourFitter::FitAtmosNCBkg ( Bool_t  fitme = true  )  [inline]

Definition at line 433 of file ThreeFlavourFitter.h.

References fFitAtmosNCBkg.

00434     {
00435       fFitAtmosNCBkg = fitme;
00436     }

void OscFit::ThreeFlavourFitter::FitAtmosNormCV ( Bool_t  fitme = true  )  [inline]

Definition at line 403 of file ThreeFlavourFitter.h.

References fFitAtmosNormCV.

00404     {
00405       fFitAtmosNormCV = fitme;
00406     }

void OscFit::ThreeFlavourFitter::FitAtmosNormRock ( Bool_t  fitme = true  )  [inline]

Definition at line 408 of file ThreeFlavourFitter.h.

References fFitAtmosNormRock.

00409     {
00410       fFitAtmosNormRock = fitme;
00411     }

void OscFit::ThreeFlavourFitter::FitAtmosNueEnergy ( Bool_t  fitme = true  )  [inline]

Definition at line 488 of file ThreeFlavourFitter.h.

References fFitAtmosNueEnergy.

00489     {
00490       fFitAtmosNueEnergy = fitme;
00491     }

void OscFit::ThreeFlavourFitter::FitAtmosNueNorm ( Bool_t  fitme = true  )  [inline]

Definition at line 423 of file ThreeFlavourFitter.h.

References fFitAtmosNueNorm.

00424     {
00425       fFitAtmosNueNorm = fitme;
00426     }

void OscFit::ThreeFlavourFitter::FitAtmosNueRatio ( Bool_t  fitme = true  )  [inline]

Definition at line 428 of file ThreeFlavourFitter.h.

References fFitAtmosNueRatio.

00429     {
00430       fFitAtmosNueRatio = fitme;
00431     }

void OscFit::ThreeFlavourFitter::FitAtmosNumuShwEn ( Bool_t  fitme = true  )  [inline]

Definition at line 483 of file ThreeFlavourFitter.h.

References fFitAtmosNumuShwEn.

00484     {
00485       fFitAtmosNumuShwEn = fitme;
00486     }

void OscFit::ThreeFlavourFitter::FitAtmosNumuTrkEn ( Bool_t  fitme = true  )  [inline]

Definition at line 473 of file ThreeFlavourFitter.h.

References fFitAtmosNumuTrkEn.

00474     {
00475       fFitAtmosNumuTrkEn = fitme;
00476     }

void OscFit::ThreeFlavourFitter::FitAtmosNumuTrkEnExit ( Bool_t  fitme = true  )  [inline]

Definition at line 478 of file ThreeFlavourFitter.h.

References fFitAtmosNumuTrkEnExit.

00479     {
00480       fFitAtmosNumuTrkEnExit = fitme;
00481     }

void OscFit::ThreeFlavourFitter::FitAtmosSpecNuBarRock ( Bool_t  fitme = true  )  [inline]

Definition at line 463 of file ThreeFlavourFitter.h.

References fFitAtmosSpecNuBarRock.

00464     {
00465       fFitAtmosSpecNuBarRock = fitme;
00466     }

void OscFit::ThreeFlavourFitter::FitAtmosSpecNueBarCV ( Bool_t  fitme = true  )  [inline]

Definition at line 453 of file ThreeFlavourFitter.h.

References fFitAtmosSpecNueBarCV.

00454     {
00455       fFitAtmosSpecNueBarCV = fitme;
00456     } 

void OscFit::ThreeFlavourFitter::FitAtmosSpecNueCV ( Bool_t  fitme = true  )  [inline]

Definition at line 448 of file ThreeFlavourFitter.h.

References fFitAtmosSpecNueCV.

00449     {
00450       fFitAtmosSpecNueCV = fitme;
00451     }

void OscFit::ThreeFlavourFitter::FitAtmosSpecNumuBarCV ( Bool_t  fitme = true  )  [inline]

Definition at line 443 of file ThreeFlavourFitter.h.

References fFitAtmosSpecNumuBarCV.

00444     {
00445       fFitAtmosSpecNumuBarCV = fitme;
00446     }  

void OscFit::ThreeFlavourFitter::FitAtmosSpecNumuCV ( Bool_t  fitme = true  )  [inline]

Definition at line 438 of file ThreeFlavourFitter.h.

References fFitAtmosSpecNumuCV.

00439     {
00440       fFitAtmosSpecNumuCV = fitme;
00441     }

void OscFit::ThreeFlavourFitter::FitAtmosSpecNuRock ( Bool_t  fitme = true  )  [inline]

Definition at line 458 of file ThreeFlavourFitter.h.

References fFitAtmosSpecNuRock.

00459     {
00460       fFitAtmosSpecNuRock = fitme;
00461     }

void OscFit::ThreeFlavourFitter::FitAtmosZenith ( Bool_t  fitme = true  )  [inline]

Definition at line 468 of file ThreeFlavourFitter.h.

References fFitAtmosZenith.

00469     {
00470       fFitAtmosZenith = fitme;
00471     }

void OscFit::ThreeFlavourFitter::FitBeamNueEnergy ( Bool_t  fitme = true  )  [inline]

Definition at line 398 of file ThreeFlavourFitter.h.

References fFitBeamNueEnergy.

00399     {
00400       fFitBeamNueEnergy = fitme;
00401     }

void OscFit::ThreeFlavourFitter::FitBeamNueNCBkg ( Bool_t  fitme = true  )  [inline]

Definition at line 393 of file ThreeFlavourFitter.h.

References fFitBeamNueNCBkg.

00394     {
00395       fFitBeamNueNCBkg = fitme;
00396     }

void OscFit::ThreeFlavourFitter::FitBeamNueNorm ( Bool_t  fitme = true  )  [inline]

Definition at line 388 of file ThreeFlavourFitter.h.

References fFitBeamNueNorm.

00389     {
00390       fFitBeamNueNorm = fitme;
00391     }

void OscFit::ThreeFlavourFitter::FitBeamNumuNCBkg ( Bool_t  fitme = true  )  [inline]

Definition at line 368 of file ThreeFlavourFitter.h.

References fFitBeamNumuNCBkg.

00369     {
00370       fFitBeamNumuNCBkg = fitme;
00371     }

void OscFit::ThreeFlavourFitter::FitBeamNumuNorm ( Bool_t  fitme = true  )  [inline]

Definition at line 363 of file ThreeFlavourFitter.h.

References fFitBeamNumuNorm.

00364     {
00365       fFitBeamNumuNorm = fitme;
00366     }

void OscFit::ThreeFlavourFitter::FitBeamNumuShwEn ( Bool_t  fitme = true  )  [inline]

Definition at line 373 of file ThreeFlavourFitter.h.

References fFitBeamNumuShwEn.

00374     {
00375       fFitBeamNumuShwEn = fitme;
00376     }

void OscFit::ThreeFlavourFitter::FitBeamNumuTrkEn ( Bool_t  fitme = true  )  [inline]

Definition at line 378 of file ThreeFlavourFitter.h.

References fFitBeamNumuTrkEn.

00379     {
00380       fFitBeamNumuTrkEn = fitme;
00381     }

void OscFit::ThreeFlavourFitter::FitBeamNumuTrkEnExit ( Bool_t  fitme = true  )  [inline]

Definition at line 383 of file ThreeFlavourFitter.h.

References fFitBeamNumuTrkEnExit.

00384     {
00385       fFitBeamNumuTrkEnExit = fitme;
00386     }

void OscFit::ThreeFlavourFitter::FitCorrelatedSystematics ( Bool_t  yesno = true  )  [inline]

Definition at line 303 of file ThreeFlavourFitter.h.

References FitSystematics(), and SwitchOnCorrelatedSystematics().

00304     {  
00305       SwitchOnCorrelatedSystematics();
00306       FitSystematics(yesno);
00307     }  

void OscFit::ThreeFlavourFitter::FitDeltaCP ( Bool_t  fitme = true  )  [inline]

Definition at line 356 of file ThreeFlavourFitter.h.

References fFitDeltaCP.

00357     {
00358       fFitDeltaCP = fitme;
00359     }

void OscFit::ThreeFlavourFitter::FitDmsq ( Bool_t  fitme = true  )  [inline]

Definition at line 341 of file ThreeFlavourFitter.h.

References fFitDmsq.

00342     {
00343       fFitDmsq = fitme;
00344     }

void OscFit::ThreeFlavourFitter::FitHierarchy ( Bool_t  fitme = true  )  [inline]

Definition at line 336 of file ThreeFlavourFitter.h.

References fFitHierarchy.

00337     {
00338       fFitHierarchy = fitme;
00339     }

void OscFit::ThreeFlavourFitter::FitOscillations ( Bool_t  yesno = true  )  [inline]

Definition at line 267 of file ThreeFlavourFitter.h.

References fFitDeltaCP, fFitDmsq, fFitSinsq13, and fFitSinsq23.

00267                                                 {
00268       fFitDmsq           = yesno;
00269       fFitSinsq23        = yesno;
00270       fFitSinsq13        = yesno;
00271       fFitDeltaCP        = yesno;
00272     }

void OscFit::ThreeFlavourFitter::FitSinsq13 ( Bool_t  fitme = true  )  [inline]

Definition at line 351 of file ThreeFlavourFitter.h.

References fFitSinsq13.

Referenced by FitSinsq13WithExternalConstraint().

00352     {
00353       fFitSinsq13 = fitme;
00354     }

void ThreeFlavourFitter::FitSinsq13WithExternalConstraint (  ) 

Definition at line 776 of file ThreeFlavourFitter.cxx.

References ApplyExternalConstraintOnSinsq13(), and FitSinsq13().

00777 {
00778   FitSinsq13(); ApplyExternalConstraintOnSinsq13();
00779 }

void OscFit::ThreeFlavourFitter::FitSinsq23 ( Bool_t  fitme = true  )  [inline]

Definition at line 346 of file ThreeFlavourFitter.h.

References fFitSinsq23.

00347     {
00348       fFitSinsq23 = fitme;
00349     }

void OscFit::ThreeFlavourFitter::FitSystematics ( Bool_t  yesno = true  )  [inline]

Definition at line 274 of file ThreeFlavourFitter.h.

References fFitAtmosChgCV, fFitAtmosChgRock, fFitAtmosNCBkg, fFitAtmosNormCV, fFitAtmosNormRock, fFitAtmosNueEnergy, fFitAtmosNueNorm, fFitAtmosNueRatio, fFitAtmosNumuShwEn, fFitAtmosNumuTrkEn, fFitAtmosNumuTrkEnExit, fFitAtmosSpecNuBarRock, fFitAtmosSpecNueBarCV, fFitAtmosSpecNueCV, fFitAtmosSpecNumuBarCV, fFitAtmosSpecNumuCV, fFitAtmosSpecNuRock, fFitAtmosZenith, fFitBeamNueEnergy, fFitBeamNueNCBkg, fFitBeamNueNorm, fFitBeamNumuNCBkg, fFitBeamNumuNorm, fFitBeamNumuShwEn, fFitBeamNumuTrkEn, and fFitBeamNumuTrkEnExit.

Referenced by FitCorrelatedSystematics().

00274                                                {
00275       fFitBeamNumuNorm       = yesno;
00276       fFitBeamNumuNCBkg      = yesno;
00277       fFitBeamNumuShwEn      = yesno;
00278       fFitBeamNumuTrkEn      = yesno;
00279       fFitBeamNumuTrkEnExit  = yesno;
00280       fFitBeamNueNorm        = yesno;
00281       fFitBeamNueNCBkg       = yesno;
00282       fFitBeamNueEnergy      = yesno;
00283       fFitAtmosNormCV        = yesno;
00284       fFitAtmosNormRock      = yesno;
00285       fFitAtmosChgCV         = yesno;
00286       fFitAtmosChgRock       = yesno;
00287       fFitAtmosNueNorm       = yesno;
00288       fFitAtmosNueRatio      = yesno;
00289       fFitAtmosNCBkg         = yesno;
00290       fFitAtmosSpecNumuCV    = yesno;
00291       fFitAtmosSpecNumuBarCV = yesno;
00292       fFitAtmosSpecNueCV     = yesno;
00293       fFitAtmosSpecNueBarCV  = yesno;
00294       fFitAtmosSpecNuRock    = yesno;
00295       fFitAtmosSpecNuBarRock = yesno;
00296       fFitAtmosZenith        = yesno;
00297       fFitAtmosNumuTrkEn     = yesno;
00298       fFitAtmosNumuTrkEnExit = yesno;
00299       fFitAtmosNumuShwEn     = yesno;
00300       fFitAtmosNueEnergy     = yesno;
00301     }

void OscFit::ThreeFlavourFitter::FixOctant ( Bool_t  yesno = true  )  [inline]

Definition at line 319 of file ThreeFlavourFitter.h.

References fFixOctant, and fSplitSinsq23.

00320     {
00321       fFixOctant = yesno; 
00322 
00323       if( yesno ) fSplitSinsq23 = true;
00324     }

Int_t ThreeFlavourFitter::GenSeed (  ) 

Definition at line 804 of file ThreeFlavourFitter.cxx.

00805 {
00806   const time_t theTime = time(0);
00807   tm* theTimeStruc = gmtime(&theTime);
00808   int seconds = 60*theTimeStruc->tm_min 
00809                  + theTimeStruc->tm_sec;
00810   int seed = seconds;
00811   return seed;
00812 }

Int_t OscFit::ThreeFlavourFitter::get_counter (  )  [inline]

Definition at line 919 of file ThreeFlavourFitter.h.

References fCtr.

Referenced by RunFitWithMinuit(), and ThreeFlavourLikelihoodFunction().

00919 { return fCtr; }

Double_t ThreeFlavourFitter::GetDeltaCP ( Int_t  n  ) 

Definition at line 636 of file ThreeFlavourFitter.cxx.

References fDeltaCPBins, fDeltaCPMax, and fDeltaCPMin.

Referenced by BuildGridDeltaCP(), CalcProfileCPV(), CalcProfileDeltaCP(), and PrintGrid().

00637 {
00638   if( fDeltaCPBins<=1 ){
00639     return fDeltaCPMin;
00640   }
00641   else if( n>=0 && n<fDeltaCPBins ){
00642     return fDeltaCPMin + (fDeltaCPMax-fDeltaCPMin)*((double)n)/(fDeltaCPBins-1.0);
00643   }
00644   else{
00645     return 0.0;
00646   }
00647 }

Int_t OscFit::ThreeFlavourFitter::GetDeltaCPBins (  )  [inline]

Definition at line 49 of file ThreeFlavourFitter.h.

References fDeltaCPBins.

Referenced by BuildGridDeltaCP(), CalcProfileCPV(), CalcProfileDeltaCP(), and PrintGrid().

00049 { return fDeltaCPBins; }

Double_t OscFit::ThreeFlavourFitter::GetDeltaCPMax (  )  [inline]

Definition at line 51 of file ThreeFlavourFitter.h.

References fDeltaCPMax.

Referenced by CalcProfileCPV(), CalcProfileDeltaCP(), and GetLnL().

00051 { return fDeltaCPMax;  }

Double_t OscFit::ThreeFlavourFitter::GetDeltaCPMin (  )  [inline]

Definition at line 50 of file ThreeFlavourFitter.h.

References fDeltaCPMin.

Referenced by CalcProfileCPV(), CalcProfileDeltaCP(), and GetLnL().

00050 { return fDeltaCPMin;  }

Double_t ThreeFlavourFitter::GetDmsq ( Int_t  n  ) 

Definition at line 597 of file ThreeFlavourFitter.cxx.

References fDmsqBins, fDmsqMax, and fDmsqMin.

Referenced by BuildGridDmsq(), PrintGrid(), and RunOscFit().

00598 {
00599   if( fDmsqBins<=1 ){
00600     return fDmsqMin;
00601   }
00602   else if( n>=0 && n<fDmsqBins ){
00603     return fDmsqMin + (fDmsqMax-fDmsqMin)*((double)n)/(fDmsqBins-1.0);
00604   }
00605   else{
00606     return 0.0;
00607   } 
00608 }

Int_t OscFit::ThreeFlavourFitter::GetDmsqBins (  )  [inline]

Definition at line 34 of file ThreeFlavourFitter.h.

References fDmsqBins.

Referenced by BuildGridDmsq(), PrintGrid(), and RunOscFit().

00034 { return fDmsqBins; }

Double_t OscFit::ThreeFlavourFitter::GetDmsqMax (  )  [inline]

Definition at line 36 of file ThreeFlavourFitter.h.

References fDmsqMax.

Referenced by GetLnL(), and RunOscFit().

00036 { return fDmsqMax;  }

Double_t OscFit::ThreeFlavourFitter::GetDmsqMin (  )  [inline]

Definition at line 35 of file ThreeFlavourFitter.h.

References fDmsqMin.

Referenced by GetLnL(), and RunOscFit().

00035 { return fDmsqMin;  }

Double_t ThreeFlavourFitter::GetLikelihood ( Double_t  input_dmsq,
Double_t  input_sinsq23,
Double_t  input_sinsq13,
Double_t  input_deltaCP,
Double_t &  osc_dmsq,
Double_t &  osc_sinsq23,
Double_t &  osc_sinsq13,
Double_t &  osc_deltaCP 
)

Definition at line 4883 of file ThreeFlavourFitter.cxx.

References fDebug, GetLnL(), UsingAtmosData(), and UsingBeamData().

04884 {
04885   osc_dmsq    = input_dmsq;
04886   osc_sinsq23 = input_sinsq23;
04887   osc_sinsq13 = input_sinsq13;
04888   osc_deltaCP = input_deltaCP;
04889 
04890   Double_t beam_numu_norm        = 0.0;   
04891   Double_t beam_numu_ncbkg       = 0.0; 
04892   Double_t beam_numu_shwen       = 0.0;
04893   Double_t beam_numu_trken       = 0.0; 
04894   Double_t beam_numu_trken_exit  = 0.0; 
04895   Double_t beam_nue_norm         = 0.0;   
04896   Double_t beam_nue_ncbkg        = 0.0; 
04897   Double_t beam_nue_energy       = 0.0;
04898   Double_t atmos_norm_cv         = 0.0;
04899   Double_t atmos_norm_rock       = 0.0;
04900   Double_t atmos_chg_cv          = 0.0;
04901   Double_t atmos_chg_rock        = 0.0;
04902   Double_t atmos_nue_norm        = 0.0;
04903   Double_t atmos_nue_ratio       = 0.0;
04904   Double_t atmos_ncbkg           = 0.0;
04905   Double_t atmos_spec_cv_numu    = 0.0;
04906   Double_t atmos_spec_cv_numubar = 0.0;
04907   Double_t atmos_spec_cv_nue     = 0.0;
04908   Double_t atmos_spec_cv_nuebar  = 0.0;
04909   Double_t atmos_spec_rock_nu    = 0.0;
04910   Double_t atmos_spec_rock_nubar = 0.0;
04911   Double_t atmos_zenith          = 0.0;
04912   Double_t atmos_numu_trken      = 0.0;
04913   Double_t atmos_numu_trken_exit = 0.0;
04914   Double_t atmos_numu_shwen      = 0.0;
04915   Double_t atmos_nue_energy      = 0.0;
04916                          
04917   Double_t LnL = 0.0;
04918 
04919   this->GetLnL( input_dmsq,         input_sinsq23,
04920                 input_sinsq13,      input_deltaCP,
04921                 osc_dmsq,           osc_sinsq23,
04922                 osc_sinsq13,        osc_deltaCP,
04923                 beam_numu_norm,     beam_numu_ncbkg,
04924                 beam_numu_shwen,    beam_numu_trken,
04925                 beam_numu_trken_exit,
04926                 beam_nue_norm,      beam_nue_ncbkg,
04927                 beam_nue_energy,
04928                 atmos_norm_cv,      atmos_norm_rock, 
04929                 atmos_chg_cv,       atmos_chg_rock, 
04930                 atmos_nue_norm,     atmos_nue_ratio,      
04931                 atmos_ncbkg,
04932                 atmos_spec_cv_numu, atmos_spec_cv_numubar,
04933                 atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
04934                 atmos_spec_rock_nu, atmos_spec_rock_nubar,
04935                 atmos_zenith,
04936                 atmos_numu_trken,   atmos_numu_trken_exit, 
04937                 atmos_numu_shwen,   atmos_nue_energy,
04938                 LnL );
04939 
04940   if( fDebug ){
04941     std::cout << " *** ThreeFlavourFitter::GetLikelihood(...) *** " << std::endl;
04942     std::cout << "  Oscillations: " << std::endl;
04943     std::cout << "   osc_dmsq:         " << osc_dmsq    << std::endl;
04944     std::cout << "   osc_sinsq23:      " << osc_sinsq23 << std::endl;
04945     std::cout << "   osc_sinsq13:      " << osc_sinsq13 << std::endl;
04946     std::cout << "   osc_deltaCP:      " << osc_deltaCP << std::endl;
04947     if( UsingBeamData() ){
04948       std::cout << "  Beam Systematics: " << std::endl;
04949       std::cout << "   beam_numu_norm:        " << beam_numu_norm        << std::endl;
04950       std::cout << "   beam_numu_ncbkg:       " << beam_numu_ncbkg       << std::endl;
04951       std::cout << "   beam_numu_shwen:       " << beam_numu_shwen       << std::endl;
04952       std::cout << "   beam_numu_trken:       " << beam_numu_trken       << std::endl;
04953       std::cout << "   beam_numu_trken_exit:  " << beam_numu_trken_exit  << std::endl;
04954       std::cout << "   beam_nue_norm:         " << beam_nue_norm         << std::endl;
04955       std::cout << "   beam_nue_ncbkg:        " << beam_nue_ncbkg        << std::endl;
04956       std::cout << "   beam_nue_energy:       " << beam_nue_energy       << std::endl;
04957     }
04958     if( UsingAtmosData() ){
04959       std::cout << "  Atmos Systematics: " << std::endl;
04960       std::cout << "   atmos_norm_cv:         " << atmos_norm_cv         << std::endl;
04961       std::cout << "   atmos_norm_rock:       " << atmos_norm_rock       << std::endl; 
04962       std::cout << "   atmos_chg_cv:          " << atmos_chg_cv          << std::endl;
04963       std::cout << "   atmos_chg_rock:        " << atmos_chg_rock        << std::endl;
04964       std::cout << "   atmos_nue_norm:        " << atmos_nue_norm        << std::endl;
04965       std::cout << "   atmos_nue_ratio:       " << atmos_nue_ratio       << std::endl;
04966       std::cout << "   atmos_ncbkg:           " << atmos_ncbkg           << std::endl;
04967       std::cout << "   atmos_spec_cv_numu:    " << atmos_spec_cv_numu    << std::endl;
04968       std::cout << "   atmos_spec_cv_numubar: " << atmos_spec_cv_numubar << std::endl; 
04969       std::cout << "   atmos_spec_cv_nue:     " << atmos_spec_cv_nue     << std::endl;
04970       std::cout << "   atmos_spec_cv_nuebar:  " << atmos_spec_cv_nuebar  << std::endl; 
04971       std::cout << "   atmos_spec_rock_nu:    " << atmos_spec_rock_nu    << std::endl;
04972       std::cout << "   atmos_spec_rock_nubar: " << atmos_spec_rock_nubar << std::endl;
04973       std::cout << "   atmos_zenith:          " << atmos_zenith          << std::endl;
04974       std::cout << "   atmos_numu_trken:      " << atmos_numu_trken      << std::endl;
04975       std::cout << "   atmos_numu_trken_exit: " << atmos_numu_trken_exit << std::endl;
04976       std::cout << "   atmos_numu_shwen:      " << atmos_numu_shwen      << std::endl;
04977       std::cout << "   atmos_nue_energy:      " << atmos_nue_energy      << std::endl;
04978     }
04979     std::cout << "  Likelihood: " << std::endl;
04980     std::cout << "   LnL=" << LnL << std::endl;
04981   }
04982 
04983   return LnL;
04984 }

Double_t ThreeFlavourFitter::GetLikelihood ( Double_t  input_dmsq,
Double_t  input_sinsq23,
Double_t  input_sinsq13,
Double_t  input_deltaCP 
)

Definition at line 4870 of file ThreeFlavourFitter.cxx.

Referenced by CalcProfileCPV(), GetLikelihoods(), and GetLnL().

04871 {
04872   Double_t osc_dmsq    = 0.0;
04873   Double_t osc_sinsq23 = 0.0;
04874   Double_t osc_sinsq13 = 0.0;
04875   Double_t osc_deltaCP = 0.0;
04876 
04877   return GetLikelihood( input_dmsq,     input_sinsq23,
04878                         input_sinsq13,  input_deltaCP,
04879                         osc_dmsq,       osc_sinsq23,
04880                         osc_sinsq13,    osc_deltaCP );
04881 }

Double_t ThreeFlavourFitter::GetLikelihoodDifferenceForDmsq (  ) 

Definition at line 5029 of file ThreeFlavourFitter.cxx.

References fDebug, and GetLikelihoods().

05030 {
05031   Double_t lnl_normal_lower   = 0.0;
05032   Double_t lnl_normal_upper   = 0.0;
05033   Double_t lnl_inverted_lower = 0.0;
05034   Double_t lnl_inverted_upper = 0.0;
05035 
05036   GetLikelihoods( lnl_normal_lower,   lnl_normal_upper,
05037                   lnl_inverted_lower, lnl_inverted_upper );
05038 
05039   Double_t lnl_normal = lnl_normal_lower;
05040   if( lnl_normal_upper<lnl_normal ) lnl_normal = lnl_normal_upper;
05041 
05042   Double_t lnl_inverted = lnl_inverted_lower;
05043   if( lnl_inverted_upper<lnl_inverted ) lnl_inverted = lnl_inverted_upper;
05044 
05045   if( fDebug ){
05046     std::cout << " *** ThreeFlavourFitter::GetLikelihoodDifferenceForDmsq(...) *** " << std::endl;
05047     std::cout << "  dLnL [Normal  ] = " << lnl_normal << std::endl;
05048     std::cout << "  dLnL [Inverted] = " << lnl_inverted << std::endl;
05049   }
05050 
05051   return lnl_inverted-lnl_normal;
05052 }

Double_t ThreeFlavourFitter::GetLikelihoodDifferenceForSinsq23 (  ) 

Definition at line 5054 of file ThreeFlavourFitter.cxx.

References fDebug, and GetLikelihoods().

05055 {
05056   Double_t lnl_normal_lower   = 0.0;
05057   Double_t lnl_normal_upper   = 0.0;
05058   Double_t lnl_inverted_lower = 0.0;
05059   Double_t lnl_inverted_upper = 0.0;
05060 
05061   GetLikelihoods( lnl_normal_lower,   lnl_normal_upper,
05062                   lnl_inverted_lower, lnl_inverted_upper );
05063 
05064   Double_t lnl_lower = lnl_normal_lower;
05065   if( lnl_inverted_lower<lnl_lower ) lnl_lower = lnl_inverted_lower;
05066 
05067   Double_t lnl_upper = lnl_normal_upper;
05068   if( lnl_inverted_upper<lnl_upper ) lnl_upper = lnl_inverted_upper;
05069 
05070   if( fDebug ){
05071     std::cout << " *** ThreeFlavourFitter::GetLikelihoodDifferenceForSinsq23(...) *** " << std::endl;
05072     std::cout << "  dLnL [Lower] = " << lnl_lower << std::endl;
05073     std::cout << "  dLnL [Upper] = " << lnl_upper << std::endl;
05074   }
05075 
05076   return lnl_upper-lnl_lower;
05077 }

void ThreeFlavourFitter::GetLikelihoods ( Double_t &  lnl_normal_lower,
Double_t &  lnl_normal_upper,
Double_t &  lnl_inverted_lower,
Double_t &  lnl_inverted_upper 
)

Definition at line 4986 of file ThreeFlavourFitter.cxx.

References fDebug, fFitHierarchy, fFixOctant, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, fSplitSinsq23, and GetLikelihood().

Referenced by GetLikelihoodDifferenceForDmsq(), and GetLikelihoodDifferenceForSinsq23().

04987 {
04988   Bool_t saveFitHierarchy = fFitHierarchy;
04989   Bool_t saveFixOctant    = fFixOctant;
04990   Bool_t saveSplitSinsq23 = fSplitSinsq23;
04991 
04992   fFitHierarchy = 0;
04993   fFixOctant    = 1;
04994   fSplitSinsq23 = 1;
04995 
04996   Double_t input_dmsq    = fSeedDmsq;    
04997   Double_t input_sinsq23 = fSeedSinsq23; 
04998   Double_t input_sinsq13 = fSeedSinsq13; 
04999   Double_t input_deltaCP = fSeedDeltaCP;
05000 
05001   if( input_dmsq<0.0 )    input_dmsq = -input_dmsq;
05002   if( input_sinsq23>0.5 ) input_sinsq23 = 1.0-input_sinsq23;
05003 
05004   Double_t LnL_NH_Lower = GetLikelihood(  input_dmsq,     input_sinsq23, input_sinsq13, input_deltaCP );
05005   Double_t LnL_NH_Upper = GetLikelihood(  input_dmsq, 1.0-input_sinsq23, input_sinsq13, input_deltaCP );
05006   Double_t LnL_IH_Lower = GetLikelihood( -input_dmsq,     input_sinsq23, input_sinsq13, input_deltaCP );
05007   Double_t LnL_IH_Upper = GetLikelihood( -input_dmsq, 1.0-input_sinsq23, input_sinsq13, input_deltaCP );
05008 
05009   fFitHierarchy = saveFitHierarchy;
05010   fFixOctant    = saveFixOctant;
05011   fSplitSinsq23 = saveSplitSinsq23;
05012 
05013   if( fDebug ){
05014     std::cout << " *** ThreeFlavourFitter::GetLikelihoodDifferences(...) *** " << std::endl;
05015     std::cout << "  dLnL [Normal  |Lower] = " << LnL_NH_Lower << std::endl;
05016     std::cout << "  dLnL [Normal  |Upper] = " << LnL_NH_Upper << std::endl;
05017     std::cout << "  dLnL [Inverted|Lower] = " << LnL_IH_Lower << std::endl;
05018     std::cout << "  dLnL [Inverted|Upper] = " << LnL_IH_Upper << std::endl;
05019   }
05020 
05021   lnl_normal_lower   = LnL_NH_Lower;
05022   lnl_normal_upper   = LnL_NH_Upper;
05023   lnl_inverted_lower = LnL_IH_Lower;
05024   lnl_inverted_upper = LnL_IH_Upper;
05025 
05026   return;
05027 }

void ThreeFlavourFitter::GetLnL ( Double_t  input_dmsq,
Double_t  input_sinsq23,
Double_t  input_sinsq13,
Double_t  input_deltaCP,
Double_t &  osc_dmsq,
Double_t &  osc_sinsq23,
Double_t &  osc_sinsq13,
Double_t &  osc_deltaCP,
Double_t &  beam_numu_norm,
Double_t &  beam_numu_ncbkg,
Double_t &  beam_numu_shwen,
Double_t &  beam_numu_trken,
Double_t &  beam_numu_trken_exit,
Double_t &  beam_nue_norm,
Double_t &  beam_nue_ncbkg,
Double_t &  beam_nue_energy,
Double_t &  atmos_norm_cv,
Double_t &  atmos_norm_rock,
Double_t &  atmos_chg_cv,
Double_t &  atmos_chg_rock,
Double_t &  atmos_nue_norm,
Double_t &  atmos_nue_ratio,
Double_t &  atmos_ncbkg,
Double_t &  atmos_spec_cv_numu,
Double_t &  atmos_spec_cv_numubar,
Double_t &  atmos_spec_cv_nue,
Double_t &  atmos_spec_cv_nuebar,
Double_t &  atmos_spec_rock_nu,
Double_t &  atmos_spec_rock_nubar,
Double_t &  atmos_zenith,
Double_t &  atmos_numu_trken,
Double_t &  atmos_numu_trken_exit,
Double_t &  atmos_numu_shwen,
Double_t &  atmos_nue_energy,
Double_t &  LnL 
)

Definition at line 5079 of file ThreeFlavourFitter.cxx.

References RunFit().

05080 {
05081   return RunFit( input_dmsq,         input_sinsq23,
05082                  input_sinsq13,      input_deltaCP,
05083                  osc_dmsq,           osc_sinsq23,
05084                  osc_sinsq13,        osc_deltaCP,
05085                  beam_numu_norm,     beam_numu_ncbkg,
05086                  beam_numu_shwen,    beam_numu_trken,
05087                  beam_numu_trken_exit,
05088                  beam_nue_norm,      beam_nue_ncbkg,
05089                  beam_nue_energy,
05090                  atmos_norm_cv,      atmos_norm_rock, 
05091                  atmos_chg_cv,       atmos_chg_rock, 
05092                  atmos_nue_norm,     atmos_nue_ratio,     
05093                  atmos_ncbkg,
05094                  atmos_spec_cv_numu, atmos_spec_cv_numubar,
05095                  atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
05096                  atmos_spec_rock_nu, atmos_spec_rock_nubar,
05097                  atmos_zenith,
05098                  atmos_numu_trken,   atmos_numu_trken_exit,
05099                  atmos_numu_shwen,   atmos_nue_energy,
05100                  LnL );
05101 }

void ThreeFlavourFitter::GetLnL ( Double_t  osc_dmsq,
Double_t  osc_sinsq23,
Double_t  osc_sinsq13,
Double_t  osc_deltaCP,
Double_t  beam_numu_norm,
Double_t  beam_numu_ncbkg,
Double_t  beam_numu_shwen,
Double_t  beam_numu_trken,
Double_t  beam_numu_trken_exit,
Double_t  beam_nue_norm,
Double_t  beam_nue_ncbkg,
Double_t  beam_numu_energy,
Double_t  atmos_norm_cv,
Double_t  atmos_norm_rock,
Double_t  atmos_chg_cv,
Double_t  atmos_chg_rock,
Double_t  atmos_nue_norm,
Double_t  atmos_nue_ratio,
Double_t  atmos_ncbkg,
Double_t  atmos_spec_cv_numu,
Double_t  atmos_spec_cv_numubar,
Double_t  atmos_spec_cv_nue,
Double_t  atmos_spec_cv_nuebar,
Double_t  atmos_spec_rock_nu,
Double_t  atmos_spec_rock_nubar,
Double_t  atmos_zenith,
Double_t  atmos_numu_trken,
Double_t  atmos_numu_trken_exit,
Double_t  atmos_numu_shwen,
Double_t  atmos_nue_energy,
Double_t &  LnL 
)

Definition at line 5103 of file ThreeFlavourFitter.cxx.

References OscFit::CalcLikelihood(), fBigNumber, fCorrelatedSystematics, fDeltaCPBoundary, fDmsqBoundary, fExternalConstraints, fExternalData, fExternalSinsq13, fExternalSinsq13Error, fInputSinsq13, fMockData, fPenaltyTerms, fSinsq13Boundary, fSinsq23Boundary, fTemplateExpt, fTemplateMC, GetDeltaCPMax(), GetDeltaCPMin(), GetDmsqMax(), GetDmsqMin(), OscFit::Configuration::GetExperiment(), GetLikelihood(), GetSinsq13Max(), GetSinsq13Min(), GetSinsq23Max(), GetSinsq23Min(), OscFit::TemplateGrid::Instance(), Instance(), OscFit::Configuration::Instance(), OscFit::kLBNE, OscFit::kMINOS, UsingAtmosData(), UsingBeamData(), UsingDeltaCP(), UsingDmsq(), UsingSinsq13(), and UsingSinsq23().

Referenced by GetLikelihood(), RunFitWithMinuit(), and ThreeFlavourLikelihoodFunction().

05104 {
05105   // Zero Log-Likelihood
05106   // ===================
05107   LnL = 0.0;
05108 
05109 
05110   // Oscillation Parameters
05111   // ======================  
05112   Double_t input_dmsq    = osc_dmsq;
05113   Double_t input_sinsq23 = osc_sinsq23;
05114   Double_t input_sinsq13 = osc_sinsq13;
05115   Double_t input_deltaCP = osc_deltaCP;
05116 
05117   // Check for Oscillations
05118   Bool_t checkOsc = 0; 
05119   if( fabs(input_dmsq)>0.0 ) checkOsc = 1; 
05120 
05121 
05122   // Systematic Parameters
05123   // =====================
05124   Double_t input_beam_numu_shwen       = beam_numu_shwen;
05125   Double_t input_beam_numu_trken       = beam_numu_trken;  
05126   Double_t input_beam_numu_trken_exit  = beam_numu_trken_exit;  
05127   Double_t input_beam_nue_energy       = beam_nue_energy;
05128   Double_t input_atmos_numu_trken      = atmos_numu_trken;
05129   Double_t input_atmos_numu_trken_exit = atmos_numu_trken_exit;
05130   Double_t input_atmos_numu_shwen      = atmos_numu_shwen; 
05131   Double_t input_atmos_nue_energy      = atmos_nue_energy;
05132 
05133   // Correlated Systematics
05134   if( fCorrelatedSystematics ){
05135 
05136     if( Configuration::Instance()->GetExperiment()==OscFit::kMINOS ){
05137       if( UsingBeamData() ){
05138         input_beam_numu_trken_exit = input_beam_numu_trken;
05139         if( UsingAtmosData() ){
05140           input_atmos_numu_trken      = input_beam_numu_trken;
05141           input_atmos_numu_shwen      = 0.7071*(input_atmos_numu_shwen+input_beam_numu_shwen);
05142         }
05143       }
05144     }
05145 
05146     else if( Configuration::Instance()->GetExperiment()==OscFit::kLBNE ){
05147       if( UsingBeamData() ){
05148         if( UsingAtmosData() ){
05149           input_atmos_numu_trken      = input_beam_numu_trken;
05150           input_atmos_numu_trken_exit = input_beam_numu_trken_exit;
05151           input_atmos_numu_shwen      = input_beam_numu_shwen;
05152           input_atmos_nue_energy      = input_beam_nue_energy;
05153         }
05154       }
05155     }
05156   }
05157 
05158 
05159   // Enforce Boundaries
05160   // ==================
05161   if( checkOsc ){
05162 
05163     // Require Grid
05164     assert( TemplateGrid::Instance()->TouchGrid() );
05165 
05166     // Dmsq Boundary
05167     if( fDmsqBoundary && UsingDmsq() ){
05168       Double_t delta_dmsq = 0.0;
05169       Double_t min_dmsq   = TemplateGrid::Instance()->GetDmsqMin();
05170       Double_t max_dmsq   = TemplateGrid::Instance()->GetDmsqMax();
05171       if( fabs(input_dmsq)>max_dmsq ){
05172         delta_dmsq = max_dmsq - fabs(input_dmsq); 
05173         if( input_dmsq>0.0 ) input_dmsq = +max_dmsq;
05174         else                 input_dmsq = -max_dmsq;
05175       }
05176       if( fabs(input_dmsq)<min_dmsq ){
05177         delta_dmsq = fabs(input_dmsq) - min_dmsq; 
05178         if( input_dmsq>0.0 ) input_dmsq = +min_dmsq;
05179         else                 input_dmsq = -min_dmsq;
05180       }
05181       LnL += 1.0e7*(delta_dmsq*delta_dmsq);
05182     }
05183  
05184     // Sinsq23 Boundary
05185     if( fSinsq23Boundary && UsingSinsq23() ){
05186       Double_t delta_sinsq23 = 0.0;
05187       Double_t min_sinsq23 = TemplateGrid::Instance()->GetSinsq23Min();
05188       Double_t max_sinsq23 = TemplateGrid::Instance()->GetSinsq23Max();
05189       if( input_sinsq23>max_sinsq23 ){
05190         delta_sinsq23 = max_sinsq23 - input_sinsq23; 
05191         input_sinsq23 = max_sinsq23;
05192       }
05193       if( input_sinsq23<min_sinsq23 ){
05194         delta_sinsq23 = input_sinsq23 - min_sinsq23; 
05195         input_sinsq23 = min_sinsq23;
05196       }
05197       LnL += 1.0e3*(delta_sinsq23*delta_sinsq23);
05198     }
05199 
05200     // Sinsq13 Boundary
05201     if( fSinsq13Boundary && UsingSinsq13() ){
05202       Double_t delta_sinsq13 = 0.0;
05203       Double_t min_sinsq13 = TemplateGrid::Instance()->GetSinsq13Min();
05204       Double_t max_sinsq13 = TemplateGrid::Instance()->GetSinsq13Max();
05205       if( input_sinsq13>max_sinsq13 ){
05206         delta_sinsq13 = max_sinsq13 - input_sinsq13; 
05207         input_sinsq13 = max_sinsq13;
05208       }
05209       if( input_sinsq13<min_sinsq13 ){
05210         delta_sinsq13 = input_sinsq13 - min_sinsq13; 
05211         input_sinsq13 = min_sinsq13;
05212       }
05213       LnL += 1.0e3*(delta_sinsq13*delta_sinsq13);
05214     } 
05215 
05216     // DeltaCP Boundary
05217     if( fDeltaCPBoundary && UsingDeltaCP() ){
05218       Double_t delta_deltaCP = 0.0;
05219       Double_t min_deltaCP = TemplateGrid::Instance()->GetDeltaCPMin();
05220       Double_t max_deltaCP = TemplateGrid::Instance()->GetDeltaCPMax();
05221       if( input_deltaCP>max_deltaCP ){
05222         delta_deltaCP = max_deltaCP - input_deltaCP; 
05223         input_deltaCP = max_deltaCP;
05224       }
05225       if( input_deltaCP<min_deltaCP ){
05226         delta_deltaCP = input_deltaCP - min_deltaCP; 
05227         input_deltaCP = min_deltaCP;
05228       }
05229       LnL += 1.0e3*(delta_deltaCP*delta_deltaCP);
05230     }
05231 
05232   } // enforce boundaries
05233 
05234 
05235   //
05236   // if( fDebug ){
05237   //   std::cout << "   GetLnL(...)  [" << input_dmsq << ", " << input_sinsq23 << ", " << input_sinsq13 << ", " << input_deltaCP << "] LnL0 = " << LnL << std::endl;
05238   // }
05239   //
05240 
05241 
05242   // Get Expectation
05243   // ===============
05244   TemplateCalculator::Instance()->GetExpectation( input_dmsq,               input_sinsq23,
05245                                                   input_sinsq13,            input_deltaCP,
05246                                                   beam_numu_norm,           beam_numu_ncbkg,
05247                                                   input_beam_numu_shwen,    input_beam_numu_trken,
05248                                                   input_beam_numu_trken_exit,
05249                                                   beam_nue_norm,            beam_nue_ncbkg,
05250                                                   input_beam_nue_energy,
05251                                                   atmos_norm_cv,            atmos_norm_rock, 
05252                                                   atmos_chg_cv,             atmos_chg_rock, 
05253                                                   atmos_nue_norm,           atmos_nue_ratio,       
05254                                                   atmos_ncbkg,
05255                                                   atmos_spec_cv_numu,       atmos_spec_cv_numubar,
05256                                                   atmos_spec_cv_nue,        atmos_spec_cv_nuebar,
05257                                                   atmos_spec_rock_nu,       atmos_spec_rock_nubar,
05258                                                   atmos_zenith,
05259                                                   input_atmos_numu_trken,   input_atmos_numu_trken_exit,
05260                                                   input_atmos_numu_shwen,   input_atmos_nue_energy,
05261                                                   fTemplateMC );
05262 
05263   LnL += OscFit::CalcLikelihood( fTemplateMC, fTemplateExpt );
05264 
05265 
05266   // Add Penalty Terms
05267   // =================
05268   if( fPenaltyTerms ){
05269     
05270     // Nominal Penalty Term
05271     LnL += 0.5*( beam_numu_norm*beam_numu_norm 
05272                + beam_numu_ncbkg*beam_numu_ncbkg 
05273                + beam_numu_shwen*beam_numu_shwen 
05274                + beam_numu_trken*beam_numu_trken
05275                + beam_numu_trken_exit*beam_numu_trken_exit
05276                + beam_nue_norm*beam_nue_norm 
05277                + beam_nue_ncbkg*beam_nue_ncbkg 
05278                + beam_nue_energy*beam_nue_energy
05279                + atmos_norm_cv*atmos_norm_cv
05280                + atmos_norm_rock*atmos_norm_rock
05281                + atmos_chg_cv*atmos_chg_cv
05282                + atmos_chg_rock*atmos_chg_rock
05283                + atmos_nue_norm*atmos_nue_norm
05284                + atmos_nue_ratio*atmos_nue_ratio
05285                + atmos_ncbkg*atmos_ncbkg
05286                + atmos_spec_cv_numu*atmos_spec_cv_numu
05287                + atmos_spec_cv_numubar*atmos_spec_cv_numubar 
05288                + atmos_spec_cv_nue*atmos_spec_cv_nue
05289                + atmos_spec_cv_nuebar*atmos_spec_cv_nuebar 
05290                + atmos_spec_rock_nu*atmos_spec_rock_nu
05291                + atmos_spec_rock_nubar*atmos_spec_rock_nubar
05292                + atmos_zenith*atmos_zenith
05293                + atmos_numu_trken*atmos_numu_trken
05294                + atmos_numu_trken_exit*atmos_numu_trken_exit
05295                + atmos_numu_shwen*atmos_numu_shwen
05296                + atmos_nue_energy*atmos_nue_energy );
05297 
05298     // Correlated Systematics
05299     if( fCorrelatedSystematics ){
05300  
05301       if( Configuration::Instance()->GetExperiment()==OscFit::kMINOS ){
05302         if( UsingBeamData() ){
05303           LnL -= 0.5*beam_numu_trken_exit*beam_numu_trken_exit;
05304           if( UsingAtmosData() ){
05305             LnL -= 0.5*( atmos_numu_shwen*atmos_numu_shwen
05306                        + atmos_numu_trken*atmos_numu_trken );
05307             LnL += 0.5*input_atmos_numu_shwen*input_atmos_numu_shwen;
05308           }
05309         }
05310       }
05311 
05312       else if( Configuration::Instance()->GetExperiment()==OscFit::kLBNE ){
05313         if( UsingBeamData() ){
05314           if( UsingAtmosData() ){
05315             LnL -= 0.5*( atmos_numu_shwen*atmos_numu_shwen
05316                        + atmos_numu_trken_exit*atmos_numu_trken_exit
05317                        + atmos_numu_trken*atmos_numu_trken
05318                        + atmos_nue_energy*atmos_nue_energy );
05319           }
05320         }
05321       }
05322     }
05323   }
05324 
05325 
05326   // Add External Constraint on Sinsq13
05327   // ==================================
05328   if( fExternalConstraints ){
05329     if( fMockData ){ // use input oscillations
05330       LnL += 0.5*(input_sinsq13-fInputSinsq13)
05331                 *(input_sinsq13-fInputSinsq13)
05332                 /(fExternalSinsq13Error*fExternalSinsq13Error);
05333     }
05334     else{ // use external value
05335       LnL += 0.5*(input_sinsq13-fExternalSinsq13)
05336                 *(input_sinsq13-fExternalSinsq13)
05337                 /(fExternalSinsq13Error*fExternalSinsq13Error);
05338     }
05339   }
05340 
05341   // Add ExternalData
05342   // ================
05343   // For now, make no distinction between real and fake data
05344   if( fExternalData ){
05345     if( fMockData ){ // fake data
05346       LnL += ExternalDataInterface::Instance()->GetLikelihood( input_dmsq, input_sinsq23, input_sinsq13, input_deltaCP );
05347     }
05348     else{ // real data
05349       LnL += ExternalDataInterface::Instance()->GetLikelihood( input_dmsq, input_sinsq23, input_sinsq13, input_deltaCP );
05350     }
05351   }
05352 
05353   // Sanity Check
05354   // ============
05355   assert( LnL<fBigNumber );
05356 
05357   return;
05358 }

Double_t ThreeFlavourFitter::GetSinsq13 ( Int_t  n  ) 

Definition at line 623 of file ThreeFlavourFitter.cxx.

References fSinsq13Bins, fSinsq13Max, and fSinsq13Min.

Referenced by BuildGridSinsq13(), and PrintGrid().

00624 {
00625   if( fSinsq13Bins<=1 ){
00626     return fSinsq13Min;
00627   }
00628   else if( n>=0 && n<fSinsq13Bins ){
00629     return fSinsq13Min + (fSinsq13Max-fSinsq13Min)*((double)n)/(fSinsq13Bins-1.0);
00630   }
00631   else{
00632     return 0.0;
00633   }
00634 }

Int_t OscFit::ThreeFlavourFitter::GetSinsq13Bins (  )  [inline]

Definition at line 44 of file ThreeFlavourFitter.h.

References fSinsq13Bins.

Referenced by BuildGridSinsq13(), and PrintGrid().

00044 { return fSinsq13Bins; }

Double_t OscFit::ThreeFlavourFitter::GetSinsq13Max (  )  [inline]

Definition at line 46 of file ThreeFlavourFitter.h.

References fSinsq13Max.

Referenced by GetLnL().

00046 { return fSinsq13Max;  }

Double_t OscFit::ThreeFlavourFitter::GetSinsq13Min (  )  [inline]

Definition at line 45 of file ThreeFlavourFitter.h.

References fSinsq13Min.

Referenced by GetLnL().

00045 { return fSinsq13Min;  }

Double_t ThreeFlavourFitter::GetSinsq23 ( Int_t  n  ) 

Definition at line 610 of file ThreeFlavourFitter.cxx.

References fSinsq23Bins, fSinsq23Max, and fSinsq23Min.

Referenced by BuildGridSinsq23(), CalcProfileSinsq23(), PrintGrid(), and RunOscFit().

00611 {
00612   if( fSinsq23Bins<=1 ){
00613     return fSinsq23Min;
00614   }
00615   else if( n>=0 && n<fSinsq23Bins ){
00616     return fSinsq23Min + (fSinsq23Max-fSinsq23Min)*((double)n)/(fSinsq23Bins-1.0);
00617   }
00618   else{
00619     return 0.0;
00620   }
00621 }

Int_t OscFit::ThreeFlavourFitter::GetSinsq23Bins (  )  [inline]

Definition at line 39 of file ThreeFlavourFitter.h.

References fSinsq23Bins.

Referenced by BuildGridSinsq23(), CalcProfileSinsq23(), PrintGrid(), and RunOscFit().

00039 { return fSinsq23Bins; }

Double_t OscFit::ThreeFlavourFitter::GetSinsq23Max (  )  [inline]

Definition at line 41 of file ThreeFlavourFitter.h.

References fSinsq23Max.

Referenced by CalcProfileSinsq23(), GetLnL(), and RunOscFit().

00041 { return fSinsq23Max;  }

Double_t OscFit::ThreeFlavourFitter::GetSinsq23Min (  )  [inline]

Definition at line 40 of file ThreeFlavourFitter.h.

References fSinsq23Min.

Referenced by CalcProfileSinsq23(), GetLnL(), and RunOscFit().

00040 { return fSinsq23Min;  }

ThreeFlavourFitter * ThreeFlavourFitter::Instance (  )  [static]
void OscFit::ThreeFlavourFitter::itr (  )  [inline]

Definition at line 917 of file ThreeFlavourFitter.h.

References fCtr.

Referenced by ThreeFlavourLikelihoodFunction().

00917 { fCtr++; }

void OscFit::ThreeFlavourFitter::PenaltyTermsOff (  )  [inline]

Definition at line 99 of file ThreeFlavourFitter.h.

References fPenaltyTerms.

00099                            {
00100       fPenaltyTerms = 0;
00101     }

void ThreeFlavourFitter::PrintExpt (  ) 

Definition at line 1311 of file ThreeFlavourFitter.cxx.

References OscFit::AsString(), fTemplateExpt, OscFit::Template::GetBinContent(), OscFit::GetCharge(), OscFit::GetContainment(), OscFit::GetFlavour(), OscFit::GetNumCharges(), OscFit::GetNumContainments(), OscFit::GetNumFlavours(), OscFit::GetNumRuns(), OscFit::GetRun(), OscFit::Template::GetTotalContent(), OscFit::Template::PrintHistograms(), and run().

Referenced by BuildExptFromData(), and BuildExptFromMC().

01312 {
01313   std::cout << " *** ThreeFlavourFitter::PrintExpt() *** " << std::endl;
01314 
01315   std::cout << "  Bin Contents: " << std::endl;
01316 
01317   for( Int_t irun=0; irun<OscFit::GetNumRuns(); irun++ ){ 
01318     for( Int_t icont=0; icont<OscFit::GetNumContainments(); icont++ ){
01319       for( Int_t iflav=0; iflav<OscFit::GetNumFlavours(); iflav++ ){
01320         for( Int_t icharge=0; icharge<OscFit::GetNumCharges(); icharge++ ){
01321 
01322           Run_t         run         = OscFit::GetRun(irun);
01323           Containment_t containment = OscFit::GetContainment(icont);
01324           Flavour_t     flavour     = OscFit::GetFlavour(iflav);
01325           Charge_t      charge      = OscFit::GetCharge(icharge);
01326 
01327           Double_t content = fTemplateExpt->GetBinContent( run, containment,
01328                                                            flavour, charge );
01329 
01330           if( content>0.0 ) std::cout << "    [" << OscFit::AsString(run) << "][" << OscFit::AsString(containment) << "][" << OscFit::AsString(flavour) << "][" << OscFit::AsString(charge) << "] Total=" << content << std::endl;
01331 
01332         }
01333       }
01334     }
01335   }
01336 
01337 
01338   std::cout << "  Total = " << fTemplateExpt->GetTotalContent() << std::endl;
01339   std::cout << "  Printing Histograms: " << std::endl;
01340 
01341   fTemplateExpt->PrintHistograms();
01342 }

void ThreeFlavourFitter::PrintGrid (  ) 

Definition at line 741 of file ThreeFlavourFitter.cxx.

References GetDeltaCP(), GetDeltaCPBins(), GetDmsq(), GetDmsqBins(), GetSinsq13(), GetSinsq13Bins(), GetSinsq23(), and GetSinsq23Bins().

Referenced by CalcProfileCPV(), CalcProfileDeltaCP(), CalcProfileSinsq23(), and RunOscFit().

00742 {
00743   std::cout << " *** ThreeFlavourFitter::PrintGrid() *** " << std::endl;
00744 
00745   std::cout << "  Dmsq Grid: " << std::endl;
00746   if( GetDmsqBins()<=0 ) std::cout << "   [Empty] " << std::endl; 
00747 
00748   for( Int_t i=0; i<GetDmsqBins(); i++ ){
00749     std::cout << "   [" << i << "] " << GetDmsq(i) << std::endl;
00750   }
00751 
00752   std::cout << "  Sinsq23 Grid: " << std::endl;
00753   if( GetSinsq23Bins()<=0 ) std::cout << "   [Empty] " << std::endl; 
00754 
00755   for( Int_t i=0; i<GetSinsq23Bins(); i++ ){
00756     std::cout << "   [" << i << "] " << GetSinsq23(i) << std::endl;
00757   }
00758 
00759   std::cout << "  Sinsq13 Grid: " << std::endl;
00760   if( GetSinsq13Bins()<=0 ) std::cout << "   [Empty] " << std::endl; 
00761 
00762   for( Int_t i=0; i<GetSinsq13Bins(); i++ ){
00763     std::cout << "   [" << i << "] " << GetSinsq13(i) << std::endl;
00764   }
00765  
00766   std::cout << "  DeltaCP Grid: " << std::endl;
00767   if( GetDeltaCPBins()<=0 ) std::cout << "   [Empty] " << std::endl; 
00768 
00769   for( Int_t i=0; i<GetDeltaCPBins(); i++ ){
00770     std::cout << "   [" << i << "] " << GetDeltaCP(i) << std::endl;
00771   }
00772 
00773   return;
00774 }

void ThreeFlavourFitter::PrintSettings (  ) 

Definition at line 435 of file ThreeFlavourFitter.cxx.

References fCorrelatedSystematics, fExternalConstraints, fExternalSinsq13, fExternalSinsq13Error, fFitAtmosChgCV, fFitAtmosChgRock, fFitAtmosNCBkg, fFitAtmosNormCV, fFitAtmosNormRock, fFitAtmosNueEnergy, fFitAtmosNueNorm, fFitAtmosNueRatio, fFitAtmosNumuShwEn, fFitAtmosNumuTrkEn, fFitAtmosNumuTrkEnExit, fFitAtmosSpecNuBarRock, fFitAtmosSpecNueBarCV, fFitAtmosSpecNueCV, fFitAtmosSpecNumuBarCV, fFitAtmosSpecNumuCV, fFitAtmosSpecNuRock, fFitAtmosZenith, fFitBeamNueEnergy, fFitBeamNueNCBkg, fFitBeamNueNorm, fFitBeamNumuNCBkg, fFitBeamNumuNorm, fFitBeamNumuShwEn, fFitBeamNumuTrkEn, fFitBeamNumuTrkEnExit, fFitDeltaCP, fFitDmsq, fFitHierarchy, fFitSinsq13, fFitSinsq23, fFixOctant, fInputAtmosChgCV, fInputAtmosChgRock, fInputAtmosNCBkg, fInputAtmosNormCV, fInputAtmosNormRock, fInputAtmosNueEnergy, fInputAtmosNueNorm, fInputAtmosNueRatio, fInputAtmosNumuShwEn, fInputAtmosNumuTrkEn, fInputAtmosNumuTrkEnExit, fInputAtmosSpecNuBarRock, fInputAtmosSpecNueBarCV, fInputAtmosSpecNueCV, fInputAtmosSpecNumuBarCV, fInputAtmosSpecNumuCV, fInputAtmosSpecNuRock, fInputAtmosZenith, fInputBeamNueEnergy, fInputBeamNueNCBkg, fInputBeamNueNorm, fInputBeamNumuNCBkg, fInputBeamNumuNorm, fInputBeamNumuShwEn, fInputBeamNumuTrkEn, fInputBeamNumuTrkEnExit, fInputDeltaCP, fInputDmsq, fInputSinsq13, fInputSinsq23, fMockData, fMockDataWithFluctuations, fPenaltyTerms, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, UsingAtmosData(), and UsingBeamData().

Referenced by CalcProfileCPV(), CalcProfileDeltaCP(), CalcProfileSinsq23(), RunFit(), RunOscFit(), and RunPseudoExpts().

00436 { 
00437   Bool_t usingBeamData  = UsingBeamData();  // Beam Data
00438   Bool_t usingAtmosData = UsingAtmosData(); // Atmos Data
00439 
00440   std::cout << " *** ThreeFlavourFitter::PrintSettings() *** " << std::endl;
00441 
00442   std::cout << "  Data Sets: " << std::endl;
00443   std::cout << "   UseBeamData = " << UsingBeamData() << std::endl;
00444   std::cout << "   UseAtmosData = " << UsingAtmosData() << std::endl;
00445   std::cout << "  Configuration: " << std::endl;
00446   std::cout << "   MockData = " << fMockData << std::endl;
00447   std::cout << "    (Fluctuations = " << fMockDataWithFluctuations << ") " << std::endl;
00448   std::cout << "   CorrelatedSystematics = " << fCorrelatedSystematics << std::endl;
00449   std::cout << "   PenaltyTerms = " << fPenaltyTerms << std::endl;
00450   std::cout << "   MassHierarchy = " << fFitHierarchy << std::endl;
00451   std::cout << "   FixOctant = " << fFixOctant << std::endl;
00452   std::cout << "   ExternalConstraints = " << fExternalConstraints << std::endl; 
00453   std::cout << "    (Sinsq13 = " << fExternalSinsq13 << "+/-" << fExternalSinsq13Error << ") " << std::endl;
00454 
00455   std::cout << "  Inputs for Building Expt: " << std::endl;
00456   std::cout << "   osc_dmsq        = " << fInputDmsq << std::endl;
00457   std::cout << "   osc_sinsq23     = " << fInputSinsq23 << std::endl;
00458   std::cout << "   osc_sinsq13     = " << fInputSinsq13 << std::endl;
00459   std::cout << "   osc_deltaCP     = " << fInputDeltaCP << std::endl;
00460   if( usingBeamData ){
00461     std::cout << "   beam_numu_norm        = " << fInputBeamNumuNorm << std::endl;
00462     std::cout << "   beam_numu_ncbkg       = " << fInputBeamNumuNCBkg << std::endl;
00463     std::cout << "   beam_numu_shwen       = " << fInputBeamNumuShwEn << std::endl;
00464     std::cout << "   beam_numu_trken       = " << fInputBeamNumuTrkEn << std::endl;
00465     std::cout << "   beam_numu_trken_exit  = " << fInputBeamNumuTrkEnExit << std::endl;
00466     std::cout << "   beam_nue_norm         = " << fInputBeamNueNorm << std::endl;
00467     std::cout << "   beam_nue_ncbkg        = " << fInputBeamNueNCBkg << std::endl;
00468     std::cout << "   beam_nue_energy       = " << fInputBeamNueEnergy << std::endl;
00469   }
00470   if( usingAtmosData ){
00471     std::cout << "   atmos_norm_cv         = " << fInputAtmosNormCV << std::endl;
00472     std::cout << "   atmos_norm_rock       = " << fInputAtmosNormRock << std::endl; 
00473     std::cout << "   atmos_chg_cv          = " << fInputAtmosChgCV << std::endl;
00474     std::cout << "   atmos_chg_rock        = " << fInputAtmosChgRock << std::endl; 
00475     std::cout << "   atmos_nue_norm        = " << fInputAtmosNueNorm << std::endl;  
00476     std::cout << "   atmos_nue_ratio       = " << fInputAtmosNueRatio << std::endl;     
00477     std::cout << "   atmos_ncbkg           = " << fInputAtmosNCBkg << std::endl;
00478     std::cout << "   atmos_spec_cv_numu    = " << fInputAtmosSpecNumuCV << std::endl;  
00479     std::cout << "   atmos_spec_cv_numubar = " << fInputAtmosSpecNumuBarCV << std::endl;
00480     std::cout << "   atmos_spec_cv_nue     = " << fInputAtmosSpecNueCV << std::endl;  
00481     std::cout << "   atmos_spec_cv_nuebar  = " << fInputAtmosSpecNueBarCV << std::endl;
00482     std::cout << "   atmos_spec_rock_nu    = " << fInputAtmosSpecNuRock << std::endl;  
00483     std::cout << "   atmos_spec_rock_nubar = " << fInputAtmosSpecNuBarRock << std::endl;
00484     std::cout << "   atmos_zenith          = " << fInputAtmosZenith << std::endl;
00485     std::cout << "   atmos_numu_trken      = " << fInputAtmosNumuTrkEn << std::endl;   
00486     std::cout << "   atmos_numu_trken_exit = " << fInputAtmosNumuTrkEnExit << std::endl;   
00487     std::cout << "   atmos_numu_shwen      = " << fInputAtmosNumuShwEn << std::endl;
00488     std::cout << "   atmos_nue_energy      = " << fInputAtmosNueEnergy << std::endl;
00489   }
00490   std::cout << "  Inputs for Seeding Fit: " << std::endl;
00491   std::cout << "   osc_dmsq    = " << fSeedDmsq << std::endl;
00492   std::cout << "   osc_sinsq23 = " << fSeedSinsq23 << std::endl;
00493   std::cout << "   osc_sinsq13 = " << fSeedSinsq13 << std::endl;
00494   std::cout << "   osc_deltaCP = " << fSeedDeltaCP << std::endl;
00495   if( usingBeamData ){
00496     std::cout << "   beam_numu_norm        = " << fSeedBeamNumuNorm << std::endl;
00497     std::cout << "   beam_numu_ncbkg       = " << fSeedBeamNumuNCBkg << std::endl;
00498     std::cout << "   beam_numu_shwen       = " << fSeedBeamNumuShwEn << std::endl;
00499     std::cout << "   beam_numu_trken       = " << fSeedBeamNumuTrkEn << std::endl;
00500     std::cout << "   beam_numu_trken_exit  = " << fSeedBeamNumuTrkEnExit << std::endl;
00501     std::cout << "   beam_nue_norm         = " << fSeedBeamNueNorm << std::endl;
00502     std::cout << "   beam_nue_ncbkg        = " << fSeedBeamNueNCBkg << std::endl;
00503     std::cout << "   beam_nue_energy       = " << fSeedBeamNueEnergy << std::endl;
00504   }
00505   if( usingAtmosData ){
00506     std::cout << "   atmos_norm_cv         = " << fSeedAtmosNormCV << std::endl;
00507     std::cout << "   atmos_norm_rock       = " << fSeedAtmosNormRock << std::endl; 
00508     std::cout << "   atmos_chg_cv          = " << fSeedAtmosChgCV << std::endl;
00509     std::cout << "   atmos_chg_rock        = " << fSeedAtmosChgRock << std::endl; 
00510     std::cout << "   atmos_nue_norm        = " << fSeedAtmosNueNorm << std::endl;  
00511     std::cout << "   atmos_nue_ratio       = " << fSeedAtmosNueRatio << std::endl;     
00512     std::cout << "   atmos_ncbkg           = " << fSeedAtmosNCBkg << std::endl;
00513     std::cout << "   atmos_spec_cv_numu    = " << fSeedAtmosSpecNumuCV << std::endl;  
00514     std::cout << "   atmos_spec_cv_numubar = " << fSeedAtmosSpecNumuBarCV << std::endl;
00515     std::cout << "   atmos_spec_cv_nue     = " << fSeedAtmosSpecNueCV << std::endl;  
00516     std::cout << "   atmos_spec_cv_nuebar  = " << fSeedAtmosSpecNueBarCV << std::endl;
00517     std::cout << "   atmos_spec_rock_nu    = " << fSeedAtmosSpecNuRock << std::endl;  
00518     std::cout << "   atmos_spec_rock_nubar = " << fSeedAtmosSpecNuBarRock << std::endl;
00519     std::cout << "   atmos_zenith          = " << fSeedAtmosZenith << std::endl;
00520     std::cout << "   atmos_numu_trken      = " << fSeedAtmosNumuTrkEn << std::endl; 
00521     std::cout << "   atmos_numu_trken_exit = " << fSeedAtmosNumuTrkEnExit << std::endl;   
00522     std::cout << "   atmos_numu_shwen      = " << fSeedAtmosNumuShwEn << std::endl;
00523     std::cout << "   atmos_nue_energy      = " << fSeedAtmosNueEnergy << std::endl;
00524   }
00525 
00526   std::cout << "  Fitting Parameters: " << std::endl;
00527   std::cout << "   osc_dmsq    = " << fFitDmsq << std::endl;
00528   std::cout << "   osc_sinsq23 = " << fFitSinsq23 << std::endl;
00529   std::cout << "   osc_sinsq13 = " << fFitSinsq13 << std::endl;
00530   std::cout << "   osc_deltaCP = " << fFitDeltaCP << std::endl;
00531   if( usingBeamData ){
00532     std::cout << "   beam_numu_norm        = " << fFitBeamNumuNorm << std::endl;
00533     std::cout << "   beam_numu_ncbkg       = " << fFitBeamNumuNCBkg << std::endl;
00534     std::cout << "   beam_numu_shwen       = " << fFitBeamNumuShwEn << std::endl;
00535     std::cout << "   beam_numu_trken       = " << fFitBeamNumuTrkEn << std::endl;
00536     std::cout << "   beam_numu_trken_exit  = " << fFitBeamNumuTrkEnExit << std::endl;
00537     std::cout << "   beam_nue_norm         = " << fFitBeamNueNorm << std::endl;
00538     std::cout << "   beam_nue_ncbkg        = " << fFitBeamNueNCBkg << std::endl;
00539     std::cout << "   beam_nue_energy       = " << fFitBeamNueEnergy << std::endl;
00540   }
00541   if( usingAtmosData ){
00542     std::cout << "   atmos_norm_cv         = " << fFitAtmosNormCV << std::endl;
00543     std::cout << "   atmos_norm_rock       = " << fFitAtmosNormRock << std::endl; 
00544     std::cout << "   atmos_chg_cv          = " << fFitAtmosChgCV << std::endl;
00545     std::cout << "   atmos_chg_rock        = " << fFitAtmosChgRock << std::endl; 
00546     std::cout << "   atmos_nue_norm        = " << fFitAtmosNueNorm << std::endl; 
00547     std::cout << "   atmos_nue_ratio       = " << fFitAtmosNueRatio << std::endl;         
00548     std::cout << "   atmos_ncbkg           = " << fFitAtmosNCBkg << std::endl;
00549     std::cout << "   atmos_spec_cv_numu    = " << fFitAtmosSpecNumuCV << std::endl;  
00550     std::cout << "   atmos_spec_cv_numubar = " << fFitAtmosSpecNumuBarCV << std::endl;
00551     std::cout << "   atmos_spec_cv_nue     = " << fFitAtmosSpecNueCV << std::endl;  
00552     std::cout << "   atmos_spec_cv_nuebar  = " << fFitAtmosSpecNueBarCV << std::endl;
00553     std::cout << "   atmos_spec_rock_nu    = " << fFitAtmosSpecNuRock << std::endl;  
00554     std::cout << "   atmos_spec_rock_nubar = " << fFitAtmosSpecNuBarRock << std::endl;
00555     std::cout << "   atmos_zenith          = " << fFitAtmosZenith << std::endl;
00556     std::cout << "   atmos_numu_trken      = " << fFitAtmosNumuTrkEn << std::endl; 
00557     std::cout << "   atmos_numu_trken_exit = " << fFitAtmosNumuTrkEnExit << std::endl;  
00558     std::cout << "   atmos_numu_shwen      = " << fFitAtmosNumuShwEn << std::endl;
00559     std::cout << "   atmos_nue_energy      = " << fFitAtmosNueEnergy << std::endl;
00560   }
00561 
00562   return; 
00563 }

void ThreeFlavourFitter::Reset (  ) 

Definition at line 426 of file ThreeFlavourFitter.cxx.

References ResetExpt().

00427 {
00428   std::cout << " *** ThreeFlavourFitter::Reset() *** " << std::endl;
00429 
00430   ResetExpt();  // reset experiment
00431 
00432   return;
00433 }

void OscFit::ThreeFlavourFitter::reset_counter (  )  [inline]

Definition at line 918 of file ThreeFlavourFitter.h.

References fCtr.

Referenced by RunFitWithMinuit().

00918 { fCtr = 0; }

void ThreeFlavourFitter::ResetExpt (  ) 

Definition at line 1344 of file ThreeFlavourFitter.cxx.

References fTemplateExpt, and OscFit::Template::Reset().

Referenced by BuildExptFromData(), BuildExptFromMC(), and Reset().

01345 {
01346   return fTemplateExpt->Reset();
01347 }

void OscFit::ThreeFlavourFitter::ResetFit (  )  [inline]

Definition at line 230 of file ThreeFlavourFitter.h.

References fFitAtmosChgCV, fFitAtmosChgRock, fFitAtmosNCBkg, fFitAtmosNormCV, fFitAtmosNormRock, fFitAtmosNueEnergy, fFitAtmosNueNorm, fFitAtmosNueRatio, fFitAtmosNumuShwEn, fFitAtmosNumuTrkEn, fFitAtmosNumuTrkEnExit, fFitAtmosSpecNuBarRock, fFitAtmosSpecNueBarCV, fFitAtmosSpecNueCV, fFitAtmosSpecNumuBarCV, fFitAtmosSpecNumuCV, fFitAtmosSpecNuRock, fFitAtmosZenith, fFitBeamNueEnergy, fFitBeamNueNCBkg, fFitBeamNueNorm, fFitBeamNumuNCBkg, fFitBeamNumuNorm, fFitBeamNumuShwEn, fFitBeamNumuTrkEn, fFitBeamNumuTrkEnExit, fFitDeltaCP, fFitDmsq, fFitHierarchy, fFitSinsq13, fFitSinsq23, fFixOctant, fSplitDeltaCP, and fSplitSinsq23.

00230                     {
00231       fFixOctant             = 0;
00232       fSplitDeltaCP          = 0;
00233       fSplitSinsq23          = 0;
00234       fFitHierarchy          = 0;
00235       fFitDmsq               = 0;
00236       fFitSinsq23            = 0;
00237       fFitSinsq13            = 0;
00238       fFitDeltaCP            = 0;
00239       fFitBeamNumuNorm       = 0;
00240       fFitBeamNumuNCBkg      = 0;  
00241       fFitBeamNumuShwEn      = 0;
00242       fFitBeamNumuTrkEn      = 0; 
00243       fFitBeamNumuTrkEnExit  = 0; 
00244       fFitBeamNueNorm        = 0;
00245       fFitBeamNueNCBkg       = 0;  
00246       fFitBeamNueEnergy      = 0;
00247       fFitAtmosNormCV        = 0;
00248       fFitAtmosNormRock      = 0;
00249       fFitAtmosChgCV         = 0;
00250       fFitAtmosChgRock       = 0;
00251       fFitAtmosNueNorm       = 0;
00252       fFitAtmosNueRatio      = 0;
00253       fFitAtmosNCBkg         = 0;
00254       fFitAtmosSpecNumuCV    = 0;
00255       fFitAtmosSpecNumuBarCV = 0;
00256       fFitAtmosSpecNueCV     = 0;
00257       fFitAtmosSpecNueBarCV  = 0;
00258       fFitAtmosSpecNuRock    = 0;
00259       fFitAtmosSpecNuBarRock = 0;
00260       fFitAtmosZenith        = 0;
00261       fFitAtmosNumuTrkEn     = 0;
00262       fFitAtmosNumuTrkEnExit = 0;
00263       fFitAtmosNumuShwEn     = 0;
00264       fFitAtmosNueEnergy     = 0;
00265     }

void ThreeFlavourFitter::RunFit (  ) 

Definition at line 3465 of file ThreeFlavourFitter.cxx.

References BuildExpt(), fOutFile, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, fWriteTemplates, Instance(), PrintSettings(), RunTemplates(), TouchExpt(), UsingAtmosData(), and UsingBeamData().

Referenced by CalcProfileDeltaCP(), CalcProfileSinsq23(), GetLnL(), RunOscFit(), and RunPseudoExpts().

03466 {  
03467   std::cout << " *** ThreeFlavourFitter::StartFit() *** " << std::endl;
03468   
03469   // Print Settings
03470   // ==============
03471   this->PrintSettings();
03472   
03473   // Build Experiment
03474   // ================
03475   if( this->TouchExpt()==0 ){
03476     this->BuildExpt();
03477   }
03478 
03479   // Write Experiment
03480   // ================
03481   if( fWriteTemplates ){
03482     this->RunTemplates();
03483   }
03484 
03485   std::cout << " *** ThreeFlavourFitter::RunFit() *** " << std::endl;
03486 
03487   // Run Oscillation Fit
03488   // ==================
03489   Double_t input_dmsq    = fSeedDmsq;
03490   Double_t input_sinsq23 = fSeedSinsq23;
03491   Double_t input_sinsq13 = fSeedSinsq13;
03492   Double_t input_deltaCP = fSeedDeltaCP;
03493 
03494   Double_t osc_dmsq              = 0.0;
03495   Double_t osc_sinsq23           = 0.0;
03496   Double_t osc_sinsq13           = 0.0;
03497   Double_t osc_deltaCP           = 0.0;
03498   Double_t beam_numu_norm        = 0.0;   
03499   Double_t beam_numu_ncbkg       = 0.0; 
03500   Double_t beam_numu_shwen       = 0.0;
03501   Double_t beam_numu_trken       = 0.0; 
03502   Double_t beam_numu_trken_exit  = 0.0; 
03503   Double_t beam_nue_norm         = 0.0;   
03504   Double_t beam_nue_ncbkg        = 0.0; 
03505   Double_t beam_nue_energy       = 0.0;
03506   Double_t atmos_norm_cv         = 0.0;
03507   Double_t atmos_norm_rock       = 0.0;
03508   Double_t atmos_chg_cv          = 0.0;
03509   Double_t atmos_chg_rock        = 0.0;
03510   Double_t atmos_nue_norm        = 0.0;
03511   Double_t atmos_nue_ratio       = 0.0;
03512   Double_t atmos_ncbkg           = 0.0;
03513   Double_t atmos_spec_cv_numu    = 0.0;
03514   Double_t atmos_spec_cv_numubar = 0.0;
03515   Double_t atmos_spec_cv_nue     = 0.0;
03516   Double_t atmos_spec_cv_nuebar  = 0.0;
03517   Double_t atmos_spec_rock_nu    = 0.0;
03518   Double_t atmos_spec_rock_nubar = 0.0;
03519   Double_t atmos_zenith          = 0.0;
03520   Double_t atmos_numu_trken      = 0.0;
03521   Double_t atmos_numu_trken_exit = 0.0;
03522   Double_t atmos_numu_shwen      = 0.0;
03523   Double_t atmos_nue_energy      = 0.0;
03524                          
03525   Double_t LnL = 0.0;
03526 
03527   this->RunFit( input_dmsq,         input_sinsq23,
03528                 input_sinsq13,      input_deltaCP,
03529                 osc_dmsq,           osc_sinsq23,
03530                 osc_sinsq13,        osc_deltaCP,
03531                 beam_numu_norm,     beam_numu_ncbkg,
03532                 beam_numu_shwen,    beam_numu_trken,
03533                 beam_numu_trken_exit,
03534                 beam_nue_norm,      beam_nue_ncbkg,
03535                 beam_nue_energy,
03536                 atmos_norm_cv,      atmos_norm_rock, 
03537                 atmos_chg_cv,       atmos_chg_rock, 
03538                 atmos_nue_norm,     atmos_nue_ratio,        
03539                 atmos_ncbkg,
03540                 atmos_spec_cv_numu, atmos_spec_cv_numubar,
03541                 atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
03542                 atmos_spec_rock_nu, atmos_spec_rock_nubar,
03543                 atmos_zenith,
03544                 atmos_numu_trken,   atmos_numu_trken_exit,
03545                 atmos_numu_shwen,   atmos_nue_energy,  
03546                 LnL );
03547 
03548   std::cout << " *** ThreeFlavourFitter::PrintResults() *** " << std::endl;
03549   std::cout << "   OSC FIT RESULTS: " << std::endl;
03550 
03551   std::cout << "    seed parameters: " << std::endl;
03552   std::cout << "     osc_dmsq    = " << fSeedDmsq << std::endl;
03553   std::cout << "     osc_sinsq23 = " << fSeedSinsq23 << std::endl;
03554   std::cout << "     osc_sinsq13 = " << fSeedSinsq13 << std::endl;
03555   std::cout << "     osc_deltaCP = " << fSeedDeltaCP << std::endl;
03556   if( UsingBeamData() ){
03557     std::cout << "     beam_numu_norm        = " << fSeedBeamNumuNorm  << std::endl;
03558     std::cout << "     beam_numu_ncbkg       = " << fSeedBeamNumuNCBkg << std::endl;
03559     std::cout << "     beam_numu_shwen       = " << fSeedBeamNumuShwEn << std::endl;
03560     std::cout << "     beam_numu_trken       = " << fSeedBeamNumuTrkEn << std::endl;
03561     std::cout << "     beam_numu_trken_exit  = " << fSeedBeamNumuTrkEnExit << std::endl;
03562     std::cout << "     beam_nue_norm         = " << fSeedBeamNueNorm  << std::endl;
03563     std::cout << "     beam_nue_ncbkg        = " << fSeedBeamNueNCBkg << std::endl;
03564     std::cout << "     beam_nue_energy       = " << fSeedBeamNueEnergy << std::endl;
03565   } 
03566   if( UsingAtmosData() ){
03567     std::cout << "     atmos_norm_cv         = " << fSeedAtmosNormCV << std::endl;
03568     std::cout << "     atmos_norm_rock       = " << fSeedAtmosNormRock << std::endl; 
03569     std::cout << "     atmos_chg_cv          = " << fSeedAtmosChgCV << std::endl;
03570     std::cout << "     atmos_chg_rock        = " << fSeedAtmosChgRock << std::endl; 
03571     std::cout << "     atmos_nue_norm        = " << fSeedAtmosNueNorm << std::endl; 
03572     std::cout << "     atmos_nue_ratio       = " << fSeedAtmosNueRatio << std::endl;         
03573     std::cout << "     atmos_ncbkg           = " << fSeedAtmosNCBkg << std::endl;
03574     std::cout << "     atmos_spec_cv_numu    = " << fSeedAtmosSpecNumuCV << std::endl;  
03575     std::cout << "     atmos_spec_cv_numubar = " << fSeedAtmosSpecNumuBarCV << std::endl;
03576     std::cout << "     atmos_spec_cv_nue     = " << fSeedAtmosSpecNueCV << std::endl;  
03577     std::cout << "     atmos_spec_cv_nuebar  = " << fSeedAtmosSpecNueBarCV << std::endl;
03578     std::cout << "     atmos_spec_rock_nu    = " << fSeedAtmosSpecNuRock << std::endl;  
03579     std::cout << "     atmos_spec_rock_nubar = " << fSeedAtmosSpecNuBarRock << std::endl;
03580     std::cout << "     atmos_zenith          = " << fSeedAtmosZenith << std::endl;
03581     std::cout << "     atmos_numu_trken      = " << fSeedAtmosNumuTrkEn << std::endl; 
03582     std::cout << "     atmos_numu_trken_exit = " << fSeedAtmosNumuTrkEnExit << std::endl;   
03583     std::cout << "     atmos_numu_shwen      = " << fSeedAtmosNumuShwEn << std::endl;
03584     std::cout << "     atmos_nue_energy      = " << fSeedAtmosNueEnergy << std::endl;
03585   }
03586 
03587   std::cout << "    best fit parameters: " << std::endl; 
03588   std::cout << "     osc_dmsq    = " << osc_dmsq << std::endl;
03589   std::cout << "     osc_sinsq23 = " << osc_sinsq23 << std::endl;
03590   std::cout << "     osc_sinsq13 = " << osc_sinsq13 << std::endl;
03591   std::cout << "     osc_deltaCP = " << osc_deltaCP << std::endl;
03592   if( UsingBeamData() ){
03593     std::cout << "     beam_numu_norm        = " << beam_numu_norm << std::endl;
03594     std::cout << "     beam_numu_ncbkg       = " << beam_numu_ncbkg << std::endl;
03595     std::cout << "     beam_numu_shwen       = " << beam_numu_shwen << std::endl;
03596     std::cout << "     beam_numu_trken       = " << beam_numu_trken << std::endl; 
03597     std::cout << "     beam_numu_trken_exit  = " << beam_numu_trken_exit << std::endl; 
03598     std::cout << "     beam_nue_norm         = " << beam_nue_norm << std::endl;
03599     std::cout << "     beam_nue_ncbkg        = " << beam_nue_ncbkg << std::endl;
03600     std::cout << "     beam_nue_energy       = " << beam_nue_energy << std::endl;
03601   }
03602   if( UsingAtmosData() ){
03603     std::cout << "     atmos_norm_cv         = " << atmos_norm_cv << std::endl;
03604     std::cout << "     atmos_norm_rock       = " << atmos_norm_rock << std::endl; 
03605     std::cout << "     atmos_chg_cv          = " << atmos_chg_cv << std::endl;
03606     std::cout << "     atmos_chg_rock        = " << atmos_chg_rock << std::endl;
03607     std::cout << "     atmos_nue_norm        = " << atmos_nue_norm << std::endl;
03608     std::cout << "     atmos_nue_ratio       = " << atmos_nue_ratio << std::endl;
03609     std::cout << "     atmos_ncbkg           = " << atmos_ncbkg << std::endl;
03610     std::cout << "     atmos_spec_cv_numu    = " << atmos_spec_cv_numu << std::endl;
03611     std::cout << "     atmos_spec_cv_numubar = " << atmos_spec_cv_numubar << std::endl; 
03612     std::cout << "     atmos_spec_cv_nue     = " << atmos_spec_cv_nue << std::endl;
03613     std::cout << "     atmos_spec_cv_nuebar  = " << atmos_spec_cv_nuebar << std::endl; 
03614     std::cout << "     atmos_spec_rock_nu    = " << atmos_spec_rock_nu << std::endl;
03615     std::cout << "     atmos_spec_rock_nubar = " << atmos_spec_rock_nubar << std::endl;
03616     std::cout << "     atmos_zenith          = " << atmos_zenith << std::endl;
03617     std::cout << "     atmos_numu_trken      = " << atmos_numu_trken << std::endl;
03618     std::cout << "     atmos_numu_trken_exit = " << atmos_numu_trken_exit << std::endl;
03619     std::cout << "     atmos_numu_shwen      = " << atmos_numu_shwen << std::endl;
03620     std::cout << "     atmos_nue_energy      = " << atmos_nue_energy << std::endl;
03621   }
03622 
03623   std::cout << "    goodness of fit: " << std::endl;
03624   std::cout << "     LnLbest=" << LnL << std::endl;  
03625  
03626   // Write Best Fit Point
03627   // ====================
03628   if( fWriteTemplates ){  
03629     TString filename = fOutFile;
03630     TString tag = ".bestfit";
03631     
03632     if( filename.EndsWith(".root") )
03633       filename.Insert(filename.Length()-5,tag);
03634     else filename.Append(tag);
03635 
03636     TemplateWriter::Instance()->WriteExpectation( osc_dmsq,           osc_sinsq23,
03637                                                   osc_sinsq13,        osc_deltaCP,
03638                                                   beam_numu_norm,     beam_numu_ncbkg,
03639                                                   beam_numu_shwen,    beam_numu_trken,
03640                                                   beam_numu_trken_exit,
03641                                                   beam_nue_norm,      beam_nue_ncbkg,
03642                                                   beam_nue_energy, 
03643                                                   atmos_norm_cv,      atmos_norm_rock, 
03644                                                   atmos_chg_cv,       atmos_chg_rock, 
03645                                                   atmos_nue_norm,     atmos_nue_ratio,         
03646                                                   atmos_ncbkg,
03647                                                   atmos_spec_cv_numu, atmos_spec_cv_numubar,
03648                                                   atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
03649                                                   atmos_spec_rock_nu, atmos_spec_rock_nubar,
03650                                                   atmos_zenith,
03651                                                   atmos_numu_trken,   atmos_numu_trken_exit, 
03652                                                   atmos_numu_shwen,   atmos_nue_energy,   
03653                                                   filename.Data() );
03654   }
03655 
03656   return;
03657 }

void ThreeFlavourFitter::RunFit ( Double_t  input_dmsq,
Double_t  input_sinsq23,
Double_t  input_sinsq13,
Double_t  input_deltaCP,
Double_t &  osc_dmsq,
Double_t &  osc_sinsq23,
Double_t &  osc_sinsq13,
Double_t &  osc_deltaCP,
Double_t &  beam_numu_norm,
Double_t &  beam_numu_ncbkg,
Double_t &  beam_numu_shwen,
Double_t &  beam_numu_trken,
Double_t &  beam_numu_trken_exit,
Double_t &  beam_nue_norm,
Double_t &  beam_nue_ncbkg,
Double_t &  beam_nue_energy,
Double_t &  atmos_norm_cv,
Double_t &  atmos_norm_rock,
Double_t &  atmos_chg_cv,
Double_t &  atmos_chg_rock,
Double_t &  atmos_nue_norm,
Double_t &  atmos_nue_ratio,
Double_t &  atmos_ncbkg,
Double_t &  atmos_spec_cv_numu,
Double_t &  atmos_spec_cv_numubar,
Double_t &  atmos_spec_cv_nue,
Double_t &  atmos_spec_cv_nuebar,
Double_t &  atmos_spec_rock_nu,
Double_t &  atmos_spec_rock_nubar,
Double_t &  atmos_zenith,
Double_t &  atmos_numu_trken,
Double_t &  atmos_numu_trken_exit,
Double_t &  atmos_numu_shwen,
Double_t &  atmos_nue_energy,
Double_t &  LnL 
)

Definition at line 3803 of file ThreeFlavourFitter.cxx.

References fBestFitAtmosChgCV, fBestFitAtmosChgRock, fBestFitAtmosNCBkg, fBestFitAtmosNormCV, fBestFitAtmosNormRock, fBestFitAtmosNueEnergy, fBestFitAtmosNueNorm, fBestFitAtmosNueRatio, fBestFitAtmosNumuShwEn, fBestFitAtmosNumuTrkEn, fBestFitAtmosNumuTrkEnExit, fBestFitAtmosSpecNuBarRock, fBestFitAtmosSpecNueBarCV, fBestFitAtmosSpecNueCV, fBestFitAtmosSpecNumuBarCV, fBestFitAtmosSpecNumuCV, fBestFitAtmosSpecNuRock, fBestFitAtmosZenith, fBestFitBeamNueEnergy, fBestFitBeamNueNCBkg, fBestFitBeamNueNorm, fBestFitBeamNumuNCBkg, fBestFitBeamNumuNorm, fBestFitBeamNumuShwEn, fBestFitBeamNumuTrkEn, fBestFitBeamNumuTrkEnExit, fBestFitLnL, fBestFitOscDeltaCP, fBestFitOscDmsq, fBestFitOscSinsq13, fBestFitOscSinsq23, fBigNumber, fDebug, fEpsilon, fFitDeltaCP, fFitHierarchy, fFitSinsq23, fFixOctant, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, fSpecialSplitSinsq23, fSplitDeltaCP, fSplitSinsq23, fSplittingDeltaCP, fSplittingSinsq23, RunFitWithMinuit(), UsingDeltaCP(), and UsingSinsq23().

03804 { 
03805 
03806   // Internal Parameters
03807   // ===================
03808   Double_t seed_dmsq    = input_dmsq;
03809   Double_t seed_sinsq23 = input_sinsq23;
03810   Double_t seed_sinsq13 = input_sinsq13;
03811   Double_t seed_deltaCP = input_deltaCP;
03812 
03813   // Initialise Log-Likelihood
03814   // =========================
03815   LnL = fBigNumber; // large number
03816 
03817   
03818   // Input Hierarchy 
03819   // ===============  
03820   if( fDebug ){
03821     if( input_dmsq>=0 ) std::cout << " *** ThreeFlavourFitter::FitNormalHierarchy(...) *** " << std::endl; 
03822     else                std::cout << " *** ThreeFlavourFitter::FitInvertedHierarchy(...) *** " << std::endl;
03823   }
03824 
03825   seed_dmsq    = input_dmsq;
03826   seed_sinsq23 = input_sinsq23;
03827   seed_sinsq13 = input_sinsq13;
03828   seed_deltaCP = input_deltaCP;
03829 
03830   fBestFitOscDmsq            = seed_dmsq;
03831   fBestFitOscSinsq23         = seed_sinsq23;
03832   fBestFitOscSinsq13         = seed_sinsq13;
03833   fBestFitOscDeltaCP         = seed_deltaCP;
03834   fBestFitBeamNumuNorm       = fSeedBeamNumuNorm;
03835   fBestFitBeamNumuNCBkg      = fSeedBeamNumuNCBkg;
03836   fBestFitBeamNumuShwEn      = fSeedBeamNumuShwEn;
03837   fBestFitBeamNumuTrkEn      = fSeedBeamNumuTrkEn;
03838   fBestFitBeamNumuTrkEnExit  = fSeedBeamNumuTrkEnExit;
03839   fBestFitBeamNueNorm        = fSeedBeamNueNorm;
03840   fBestFitBeamNueNCBkg       = fSeedBeamNueNCBkg;
03841   fBestFitBeamNueEnergy      = fSeedBeamNueEnergy;
03842   fBestFitAtmosNormCV        = fSeedAtmosNormCV;
03843   fBestFitAtmosNormRock      = fSeedAtmosNormRock;
03844   fBestFitAtmosChgCV         = fSeedAtmosChgCV;
03845   fBestFitAtmosChgRock       = fSeedAtmosChgRock;
03846   fBestFitAtmosNueNorm       = fSeedAtmosNueNorm;
03847   fBestFitAtmosNueRatio      = fSeedAtmosNueRatio;
03848   fBestFitAtmosNCBkg         = fSeedAtmosNCBkg;
03849   fBestFitAtmosSpecNumuCV    = fSeedAtmosSpecNumuCV;
03850   fBestFitAtmosSpecNumuBarCV = fSeedAtmosSpecNumuBarCV;
03851   fBestFitAtmosSpecNueCV     = fSeedAtmosSpecNueCV;
03852   fBestFitAtmosSpecNueBarCV  = fSeedAtmosSpecNueBarCV;
03853   fBestFitAtmosSpecNuRock    = fSeedAtmosSpecNuRock;
03854   fBestFitAtmosSpecNuBarRock = fSeedAtmosSpecNuBarRock;
03855   fBestFitAtmosZenith        = fSeedAtmosZenith;
03856   fBestFitAtmosNumuTrkEn     = fSeedAtmosNumuTrkEn;
03857   fBestFitAtmosNumuTrkEnExit = fSeedAtmosNumuTrkEnExit;
03858   fBestFitAtmosNumuShwEn     = fSeedAtmosNumuShwEn;
03859   fBestFitAtmosNueEnergy     = fSeedAtmosNueEnergy;
03860   fBestFitLnL                = fBigNumber; // large number
03861 
03862   fSplittingSinsq23 = 0;   
03863   fSplittingDeltaCP = 0;   
03864 
03865   if( UsingSinsq23() && fFitSinsq23 && fSplitSinsq23 ) fSplittingSinsq23 = 1; 
03866   if( UsingDeltaCP() && fFitDeltaCP && fSplitDeltaCP ) fSplittingDeltaCP = 1; 
03867 
03868   if( fSplittingSinsq23 ){
03869     if( seed_sinsq23>0.5-fEpsilon && seed_sinsq23<=0.5          ) seed_sinsq23 = 0.5 - fEpsilon;
03870     if( seed_sinsq23>0.5          && seed_sinsq23< 0.5+fEpsilon ) seed_sinsq23 = 0.5 + fEpsilon;
03871   }
03872 
03873   if( fSplittingDeltaCP ){
03874     if( seed_deltaCP>TMath::Pi()-fEpsilon && seed_deltaCP<=TMath::Pi()          ) seed_deltaCP = TMath::Pi() - fEpsilon;
03875     if( seed_deltaCP>TMath::Pi()          && seed_deltaCP< TMath::Pi()+fEpsilon ) seed_deltaCP = TMath::Pi() + fEpsilon; 
03876   }
03877 
03878   RunFitWithMinuit( seed_dmsq,
03879                     seed_sinsq23,
03880                     seed_sinsq13,
03881                     seed_deltaCP );
03882 
03883  
03884   if( fSplittingDeltaCP ) {
03885     RunFitWithMinuit( seed_dmsq,
03886                       seed_sinsq23,
03887                       seed_sinsq13,
03888                       2.0*TMath::Pi()-seed_deltaCP );
03889   } 
03890 
03891   if( fSplittingSinsq23 && !fFixOctant ) {
03892     RunFitWithMinuit( seed_dmsq,
03893                       1.0-seed_sinsq23,
03894                       seed_sinsq13,
03895                       seed_deltaCP );
03896   }
03897 
03898   if( fSplittingSinsq23 && !fFixOctant && fSplittingDeltaCP ) {
03899     RunFitWithMinuit( seed_dmsq,
03900                       1.0-seed_sinsq23,
03901                       seed_sinsq13,
03902                       2.0*TMath::Pi()-seed_deltaCP );
03903   } 
03904 
03905   if( fSplittingSinsq23 || fSplittingDeltaCP ) {
03906     fSplittingDeltaCP = 0; if( !fFixOctant ) fSplittingSinsq23 = 0; 
03907     RunFitWithMinuit( fBestFitOscDmsq, fBestFitOscSinsq23,
03908                       fBestFitOscSinsq13, fBestFitOscDeltaCP );
03909   }
03910 
03911   // (Special Mode for Octant Sensitivities)
03912   if( fSplittingSinsq23 && fFixOctant && fSpecialSplitSinsq23 ){
03913     Bool_t saveFitSinsq23 = fFitSinsq23;
03914     fFitSinsq23 = false;
03915     RunFitWithMinuit( fBestFitOscDmsq, 0.500, 
03916                       fBestFitOscSinsq13, fBestFitOscDeltaCP );
03917     fFitSinsq23 = saveFitSinsq23;
03918   }
03919 
03920   // Set Best Fit Parameters
03921   if( fBestFitLnL<LnL ){
03922     osc_dmsq              = fBestFitOscDmsq; 
03923     osc_sinsq23           = fBestFitOscSinsq23; 
03924     osc_sinsq13           = fBestFitOscSinsq13; 
03925     osc_deltaCP           = fBestFitOscDeltaCP;
03926     beam_numu_norm        = fBestFitBeamNumuNorm; 
03927     beam_numu_ncbkg       = fBestFitBeamNumuNCBkg; 
03928     beam_numu_shwen       = fBestFitBeamNumuShwEn; 
03929     beam_numu_trken       = fBestFitBeamNumuTrkEn;
03930     beam_numu_trken_exit  = fBestFitBeamNumuTrkEnExit;
03931     beam_nue_norm         = fBestFitBeamNueNorm; 
03932     beam_nue_ncbkg        = fBestFitBeamNueNCBkg; 
03933     beam_nue_energy       = fBestFitBeamNueEnergy; 
03934     atmos_norm_cv         = fBestFitAtmosNormCV;
03935     atmos_norm_rock       = fBestFitAtmosNormRock;
03936     atmos_chg_cv          = fBestFitAtmosChgCV;
03937     atmos_chg_rock        = fBestFitAtmosChgRock;
03938     atmos_nue_norm        = fBestFitAtmosNueNorm;
03939     atmos_nue_ratio       = fBestFitAtmosNueRatio;
03940     atmos_ncbkg           = fBestFitAtmosNCBkg;
03941     atmos_spec_cv_numu    = fBestFitAtmosSpecNumuCV;
03942     atmos_spec_cv_numubar = fBestFitAtmosSpecNumuBarCV;
03943     atmos_spec_cv_nue     = fBestFitAtmosSpecNueCV;
03944     atmos_spec_cv_nuebar  = fBestFitAtmosSpecNueBarCV;
03945     atmos_spec_rock_nu    = fBestFitAtmosSpecNuRock;
03946     atmos_spec_rock_nubar = fBestFitAtmosSpecNuBarRock;
03947     atmos_zenith          = fBestFitAtmosZenith;
03948     atmos_numu_trken      = fBestFitAtmosNumuTrkEn;
03949     atmos_numu_trken_exit = fBestFitAtmosNumuTrkEnExit;
03950     atmos_numu_shwen      = fBestFitAtmosNumuShwEn;
03951     atmos_nue_energy      = fBestFitAtmosNueEnergy;
03952 
03953     LnL = fBestFitLnL;
03954   }
03955 
03956 
03957   if( fFitHierarchy==false ) return;
03958 
03959 
03960   // Opposite Hierarchy 
03961   // ================== 
03962   if( fDebug ){
03963     if( input_dmsq<0 ) std::cout << " *** ThreeFlavourFitter::FitNormalHierarchy(...) *** " << std::endl; 
03964     else               std::cout << " *** ThreeFlavourFitter::FitInvertedHierarchy(...) *** " << std::endl;
03965   }
03966 
03967   seed_dmsq    = -input_dmsq;
03968   seed_sinsq23 =  input_sinsq23;
03969   seed_sinsq13 =  input_sinsq13;
03970   seed_deltaCP =  input_deltaCP;
03971 
03972   fBestFitOscDmsq            = seed_dmsq;
03973   fBestFitOscSinsq23         = seed_sinsq23;
03974   fBestFitOscSinsq13         = seed_sinsq13;
03975   fBestFitOscDeltaCP         = seed_deltaCP;
03976   fBestFitBeamNumuNorm       = fSeedBeamNumuNorm;
03977   fBestFitBeamNumuNCBkg      = fSeedBeamNumuNCBkg;
03978   fBestFitBeamNumuShwEn      = fSeedBeamNumuShwEn;
03979   fBestFitBeamNumuTrkEn      = fSeedBeamNumuTrkEn;
03980   fBestFitBeamNumuTrkEnExit  = fSeedBeamNumuTrkEnExit;
03981   fBestFitBeamNueNorm        = fSeedBeamNueNorm;
03982   fBestFitBeamNueNCBkg       = fSeedBeamNueNCBkg;
03983   fBestFitBeamNueEnergy      = fSeedBeamNueEnergy;
03984   fBestFitAtmosNormCV        = fSeedAtmosNormCV;
03985   fBestFitAtmosNormRock      = fSeedAtmosNormRock;
03986   fBestFitAtmosChgCV         = fSeedAtmosChgCV;
03987   fBestFitAtmosChgRock       = fSeedAtmosChgRock;
03988   fBestFitAtmosNueNorm       = fSeedAtmosNueNorm;
03989   fBestFitAtmosNueRatio      = fSeedAtmosNueRatio;
03990   fBestFitAtmosNCBkg         = fSeedAtmosNCBkg;
03991   fBestFitAtmosSpecNumuCV    = fSeedAtmosSpecNumuCV;
03992   fBestFitAtmosSpecNumuBarCV = fSeedAtmosSpecNumuBarCV; 
03993   fBestFitAtmosSpecNueCV     = fSeedAtmosSpecNueCV;
03994   fBestFitAtmosSpecNueBarCV  = fSeedAtmosSpecNueBarCV; 
03995   fBestFitAtmosSpecNuRock    = fSeedAtmosSpecNuRock;
03996   fBestFitAtmosSpecNuBarRock = fSeedAtmosSpecNuBarRock;
03997   fBestFitAtmosZenith        = fSeedAtmosZenith;
03998   fBestFitAtmosNumuTrkEn     = fSeedAtmosNumuTrkEn;
03999   fBestFitAtmosNumuTrkEnExit = fSeedAtmosNumuTrkEnExit;
04000   fBestFitAtmosNumuShwEn     = fSeedAtmosNumuShwEn;
04001   fBestFitAtmosNueEnergy     = fSeedAtmosNueEnergy;
04002   fBestFitLnL                = fBigNumber; // large number
04003 
04004   fSplittingSinsq23 = 0;   
04005   fSplittingDeltaCP = 0;   
04006 
04007   if( UsingSinsq23() && fFitSinsq23 && fSplitSinsq23 ) fSplittingSinsq23 = 1; 
04008   if( UsingDeltaCP() && fFitDeltaCP && fSplitDeltaCP ) fSplittingDeltaCP = 1; 
04009  
04010   if( fSplittingSinsq23 ){
04011     if( seed_sinsq23>0.5-fEpsilon && seed_sinsq23<=0.5          ) seed_sinsq23 = 0.5 - fEpsilon;
04012     if( seed_sinsq23>0.5          && seed_sinsq23< 0.5+fEpsilon ) seed_sinsq23 = 0.5 + fEpsilon;
04013   }
04014 
04015   if( fSplittingDeltaCP ){
04016     if( seed_deltaCP>TMath::Pi()-fEpsilon && seed_deltaCP<=TMath::Pi()          ) seed_deltaCP = TMath::Pi() - fEpsilon;
04017     if( seed_deltaCP>TMath::Pi()          && seed_deltaCP< TMath::Pi()+fEpsilon ) seed_deltaCP = TMath::Pi() + fEpsilon; 
04018   }
04019 
04020   RunFitWithMinuit( seed_dmsq,
04021                     seed_sinsq23,
04022                     seed_sinsq13,
04023                     seed_deltaCP );
04024 
04025   if( fSplittingDeltaCP ) {
04026     RunFitWithMinuit( seed_dmsq,
04027                       seed_sinsq23,
04028                       seed_sinsq13,
04029                       2.0*TMath::Pi()-seed_deltaCP );
04030   }
04031 
04032   if( fSplittingSinsq23 && !fFixOctant) {
04033     RunFitWithMinuit( seed_dmsq,
04034                       1.0-seed_sinsq23,
04035                       seed_sinsq13,
04036                       seed_deltaCP );
04037   }
04038 
04039   if( fSplittingSinsq23  && !fFixOctant && fSplittingDeltaCP ) {
04040     RunFitWithMinuit( seed_dmsq,
04041                       1.0-seed_sinsq23,
04042                       seed_sinsq13,
04043                       2.0*TMath::Pi()-seed_deltaCP );
04044   }
04045 
04046   if( fSplittingSinsq23 || fSplittingDeltaCP ) {
04047     fSplittingDeltaCP = 0; if( !fFixOctant ) fSplittingSinsq23 = 0; 
04048     RunFitWithMinuit( fBestFitOscDmsq, fBestFitOscSinsq23,
04049                       fBestFitOscSinsq13, fBestFitOscDeltaCP );
04050   }
04051 
04052   // (Special Mode for Octant Sensitivities)
04053   if( fSplittingSinsq23 && fFixOctant && fSpecialSplitSinsq23 ){
04054     Bool_t saveFitSinsq23 = fFitSinsq23;
04055     fFitSinsq23 = false;
04056     RunFitWithMinuit( fBestFitOscDmsq, 0.500, 
04057                       fBestFitOscSinsq13, fBestFitOscDeltaCP );
04058     fFitSinsq23 = saveFitSinsq23;
04059   }
04060 
04061   // Set Best Fit Parameters 
04062   if( fBestFitLnL<LnL ){
04063     osc_dmsq              = fBestFitOscDmsq; 
04064     osc_sinsq23           = fBestFitOscSinsq23; 
04065     osc_sinsq13           = fBestFitOscSinsq13; 
04066     osc_deltaCP           = fBestFitOscDeltaCP;
04067     beam_numu_norm        = fBestFitBeamNumuNorm; 
04068     beam_numu_ncbkg       = fBestFitBeamNumuNCBkg; 
04069     beam_numu_shwen       = fBestFitBeamNumuShwEn; 
04070     beam_numu_trken       = fBestFitBeamNumuTrkEn;
04071     beam_numu_trken_exit  = fBestFitBeamNumuTrkEnExit;
04072     beam_nue_norm         = fBestFitBeamNueNorm; 
04073     beam_nue_ncbkg        = fBestFitBeamNueNCBkg; 
04074     beam_nue_energy       = fBestFitBeamNueEnergy; 
04075     atmos_norm_cv         = fBestFitAtmosNormCV;
04076     atmos_norm_rock       = fBestFitAtmosNormRock;
04077     atmos_chg_cv          = fBestFitAtmosChgCV;
04078     atmos_chg_rock        = fBestFitAtmosChgRock;
04079     atmos_nue_norm        = fBestFitAtmosNueNorm;
04080     atmos_nue_ratio       = fBestFitAtmosNueRatio;
04081     atmos_ncbkg           = fBestFitAtmosNCBkg;
04082     atmos_spec_cv_numu    = fBestFitAtmosSpecNumuCV;
04083     atmos_spec_cv_numubar = fBestFitAtmosSpecNumuBarCV;
04084     atmos_spec_cv_nue     = fBestFitAtmosSpecNueCV;
04085     atmos_spec_cv_nuebar  = fBestFitAtmosSpecNueBarCV;
04086     atmos_spec_rock_nu    = fBestFitAtmosSpecNuRock;
04087     atmos_spec_rock_nubar = fBestFitAtmosSpecNuBarRock;
04088     atmos_zenith          = fBestFitAtmosZenith;
04089     atmos_numu_trken      = fBestFitAtmosNumuTrkEn;
04090     atmos_numu_trken_exit = fBestFitAtmosNumuTrkEnExit;
04091     atmos_numu_shwen      = fBestFitAtmosNumuShwEn;
04092     atmos_nue_energy      = fBestFitAtmosNueEnergy;
04093 
04094     LnL = fBestFitLnL;
04095   }
04096   
04097   return;
04098 }

void ThreeFlavourFitter::RunFitWithMinuit (  )  [private]

Definition at line 4339 of file ThreeFlavourFitter.cxx.

References err(), fAtmosChgCV, fAtmosChgRock, fAtmosNCBkg, fAtmosNormCV, fAtmosNormRock, fAtmosNueEnergy, fAtmosNueNorm, fAtmosNueRatio, fAtmosNumuShwEn, fAtmosNumuTrkEn, fAtmosNumuTrkEnExit, fAtmosSpecNuBarRock, fAtmosSpecNueBarCV, fAtmosSpecNueCV, fAtmosSpecNumuBarCV, fAtmosSpecNumuCV, fAtmosSpecNuRock, fAtmosZenith, fBeamNueEnergy, fBeamNueNCBkg, fBeamNueNorm, fBeamNumuNCBkg, fBeamNumuNorm, fBeamNumuShwEn, fBeamNumuTrkEn, fBeamNumuTrkEnExit, fCorrelatedSystematics, fDebug, fEpsilon, fFitAtmosChgCV, fFitAtmosChgRock, fFitAtmosNCBkg, fFitAtmosNormCV, fFitAtmosNormRock, fFitAtmosNueEnergy, fFitAtmosNueNorm, fFitAtmosNueRatio, fFitAtmosNumuShwEn, fFitAtmosNumuTrkEn, fFitAtmosNumuTrkEnExit, fFitAtmosSpecNuBarRock, fFitAtmosSpecNueBarCV, fFitAtmosSpecNueCV, fFitAtmosSpecNumuBarCV, fFitAtmosSpecNumuCV, fFitAtmosSpecNuRock, fFitAtmosZenith, fFitBeamNueEnergy, fFitBeamNueNCBkg, fFitBeamNueNorm, fFitBeamNumuNCBkg, fFitBeamNumuNorm, fFitBeamNumuShwEn, fFitBeamNumuTrkEn, fFitBeamNumuTrkEnExit, fFitDeltaCP, fFitDmsq, fFitSinsq13, fFitSinsq23, fFittingAtmosChgCV, fFittingAtmosChgRock, fFittingAtmosNCBkg, fFittingAtmosNormCV, fFittingAtmosNormRock, fFittingAtmosNueEnergy, fFittingAtmosNueNorm, fFittingAtmosNueRatio, fFittingAtmosNumuShwEn, fFittingAtmosNumuTrkEn, fFittingAtmosNumuTrkEnExit, fFittingAtmosSpecNuBarRock, fFittingAtmosSpecNueBarCV, fFittingAtmosSpecNueCV, fFittingAtmosSpecNumuBarCV, fFittingAtmosSpecNumuCV, fFittingAtmosSpecNuRock, fFittingAtmosZenith, fFittingBeamNueEnergy, fFittingBeamNueNCBkg, fFittingBeamNueNorm, fFittingBeamNumuNCBkg, fFittingBeamNumuNorm, fFittingBeamNumuShwEn, fFittingBeamNumuTrkEn, fFittingBeamNumuTrkEnExit, fFittingDeltaCP, fFittingDmsq, fFittingSinsq13, fFittingSinsq23, fMaskAtmosChgCV, fMaskAtmosChgRock, fMaskAtmosNCBkg, fMaskAtmosNormCV, fMaskAtmosNormRock, fMaskAtmosNueEnergy, fMaskAtmosNueNorm, fMaskAtmosNueRatio, fMaskAtmosNumuShwEn, fMaskAtmosNumuTrkEn, fMaskAtmosNumuTrkEnExit, fMaskAtmosSpecNuBarRock, fMaskAtmosSpecNueBarCV, fMaskAtmosSpecNueCV, fMaskAtmosSpecNumuBarCV, fMaskAtmosSpecNumuCV, fMaskAtmosSpecNuRock, fMaskAtmosZenith, fMaskBeamNueEnergy, fMaskBeamNueNCBkg, fMaskBeamNueNorm, fMaskBeamNumuNCBkg, fMaskBeamNumuNorm, fMaskBeamNumuShwEn, fMaskBeamNumuTrkEn, fMaskBeamNumuTrkEnExit, fMaskDeltaCP, fMaskDmsq, fMaskSinsq13, fMaskSinsq23, fMinuit, fMinuitStatus, fOscDeltaCP, fOscDmsq, fOscSinsq13, fOscSinsq23, fOutputLnL, fSpecialSplitSinsq23, fSplittingDeltaCP, fSplittingSinsq23, fUseSimplex, fZeta, get_counter(), OscFit::Configuration::GetExperiment(), GetLnL(), Instance(), OscFit::Configuration::Instance(), OscFit::kAtmosData, OscFit::kBeamData, OscFit::kCV, OscFit::kLBNE, OscFit::kMINOS, OscFit::kNCbkg, OscFit::kNueEnergy, OscFit::kNueNCbkg, OscFit::kRock, OscFit::kShwEn, OscFit::kSpec, OscFit::kTrkEn, OscFit::kTrkEnExit, OscFit::kZenith, reset_counter(), ThreeFlavourLikelihoodFunction(), UsingAtmosData(), UsingBeamData(), UsingDeltaCP(), UsingDmsq(), UsingSinsq13(), and UsingSinsq23().

Referenced by RunFit(), and RunFitWithMinuitInSteps().

04340 {
04341   // switch off parameters
04342   fFittingDmsq               = 0;
04343   fFittingSinsq23            = 0;
04344   fFittingSinsq13            = 0;
04345   fFittingDeltaCP            = 0;
04346   fFittingBeamNumuNorm       = 0;
04347   fFittingBeamNumuNCBkg      = 0;
04348   fFittingBeamNumuShwEn      = 0;
04349   fFittingBeamNumuTrkEn      = 0;
04350   fFittingBeamNumuTrkEnExit  = 0;
04351   fFittingBeamNueNorm        = 0;
04352   fFittingBeamNueNCBkg       = 0;
04353   fFittingBeamNueEnergy      = 0;
04354   fFittingAtmosNormCV        = 0;
04355   fFittingAtmosNormRock      = 0;
04356   fFittingAtmosChgCV         = 0;
04357   fFittingAtmosChgRock       = 0;
04358   fFittingAtmosNueNorm       = 0;
04359   fFittingAtmosNueRatio      = 0;
04360   fFittingAtmosNCBkg         = 0;
04361   fFittingAtmosSpecNumuCV    = 0;
04362   fFittingAtmosSpecNumuBarCV = 0; 
04363   fFittingAtmosSpecNueCV     = 0;
04364   fFittingAtmosSpecNueBarCV  = 0; 
04365   fFittingAtmosSpecNuRock    = 0;
04366   fFittingAtmosSpecNuBarRock = 0;
04367   fFittingAtmosZenith        = 0;
04368   fFittingAtmosNumuTrkEn     = 0;
04369   fFittingAtmosNumuTrkEnExit = 0;
04370   fFittingAtmosNumuShwEn     = 0;
04371   fFittingAtmosNueEnergy     = 0;
04372 
04373   // switch on parameters
04374   if( UsingDmsq() ){
04375     fFittingDmsq    = ( fMaskDmsq && fFitDmsq );
04376   }
04377 
04378   if( UsingSinsq23() ){
04379     fFittingSinsq23 = ( fMaskSinsq23 && fFitSinsq23 );
04380   }
04381 
04382   if( UsingSinsq13() ){
04383     fFittingSinsq13 = ( fMaskSinsq13 && fFitSinsq13 );
04384   }
04385 
04386   if( UsingDeltaCP() ){
04387     fFittingDeltaCP = ( fMaskDeltaCP && fFitDeltaCP ); 
04388   }
04389 
04390   if( UsingBeamData() ){
04391     fFittingBeamNumuNorm       = ( fMaskBeamNumuNorm && fFitBeamNumuNorm );
04392     fFittingBeamNumuNCBkg      = ( fMaskBeamNumuNCBkg && fFitBeamNumuNCBkg
04393                             && TemplateGrid::Instance()->TouchSystematic( OscFit::kBeamData, OscFit::kNCbkg ) );
04394     fFittingBeamNumuShwEn      = ( fMaskBeamNumuShwEn && fFitBeamNumuShwEn
04395                             && TemplateGrid::Instance()->TouchSystematic( OscFit::kBeamData, OscFit::kShwEn ) );
04396     fFittingBeamNumuTrkEn      = ( fMaskBeamNumuTrkEn && fFitBeamNumuTrkEn
04397                             && TemplateGrid::Instance()->TouchSystematic( OscFit::kBeamData, OscFit::kTrkEn ) );
04398     fFittingBeamNumuTrkEnExit  = ( fMaskBeamNumuTrkEnExit && fFitBeamNumuTrkEnExit
04399                             && TemplateGrid::Instance()->TouchSystematic( OscFit::kBeamData, OscFit::kTrkEnExit ) );
04400     fFittingBeamNueNorm        = ( fMaskBeamNueNorm && fFitBeamNueNorm 
04401                             && Configuration::Instance()->UsingBeamMuonNeutrinosOnly()==false
04402                             && TemplateGrid::Instance()->TouchBeamNueMC()==true );
04403     fFittingBeamNueNCBkg       = ( fMaskBeamNueNCBkg && fFitBeamNueNCBkg
04404                             && Configuration::Instance()->UsingBeamMuonNeutrinosOnly()==false
04405                             && TemplateGrid::Instance()->TouchSystematic( OscFit::kBeamData, OscFit::kNueNCbkg ) 
04406                             && TemplateGrid::Instance()->TouchBeamNueMC()==true );
04407     fFittingBeamNueEnergy      = ( fMaskBeamNueEnergy && fFitBeamNueEnergy
04408                             && Configuration::Instance()->UsingBeamMuonNeutrinosOnly()==false
04409                             && Configuration::Instance()->DoingNueEnergySystematic()==true  
04410                             && TemplateGrid::Instance()->TouchSystematic( OscFit::kBeamData, OscFit::kNueEnergy ) 
04411                             && TemplateGrid::Instance()->TouchBeamNueMC()==true );
04412   }
04413 
04414   if( UsingAtmosData() ){
04415     fFittingAtmosNormCV        = ( fMaskAtmosNormCV && fFitAtmosNormCV );
04416     fFittingAtmosChgCV         = ( fMaskAtmosChgCV && fFitAtmosChgCV );
04417     fFittingAtmosNormRock      = ( fMaskAtmosNormRock && fFitAtmosNormRock
04418                                 && Configuration::Instance()->UsingContainedVertexOnly()==false 
04419                                 && TemplateGrid::Instance()->TouchAtmosRockMC()==true );
04420     fFittingAtmosChgRock       = ( fMaskAtmosChgRock && fFitAtmosChgRock
04421                                 && Configuration::Instance()->UsingContainedVertexOnly()==false 
04422                                 && TemplateGrid::Instance()->TouchAtmosRockMC()==true );
04423     fFittingAtmosNueNorm       = ( fMaskAtmosNueNorm && fFitAtmosNueNorm
04424                                 && Configuration::Instance()->UsingAtmosMuonNeutrinosOnly()==false );
04425     fFittingAtmosNueRatio      = ( fMaskAtmosNueRatio && fFitAtmosNueRatio
04426                                 && Configuration::Instance()->UsingAtmosMuonNeutrinosOnly()==false
04427                                 && Configuration::Instance()->DoingNueSpectrumSystematic()==true );
04428     fFittingAtmosNCBkg         = ( fMaskAtmosNCBkg && fFitAtmosNCBkg );
04429     fFittingAtmosSpecNumuCV    = ( fMaskAtmosSpecNumuCV && fFitAtmosSpecNumuCV
04430                                 && fMaskAtmosSpecNumuBarCV && fFitAtmosSpecNumuBarCV 
04431                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kCV, OscFit::kSpec ) );
04432     fFittingAtmosSpecNumuBarCV = ( fMaskAtmosSpecNumuCV && fFitAtmosSpecNumuCV
04433                                 && fMaskAtmosSpecNumuBarCV && fFitAtmosSpecNumuBarCV 
04434                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kCV, OscFit::kSpec ) ); 
04435     fFittingAtmosSpecNueCV     = ( fMaskAtmosSpecNueCV && fFitAtmosSpecNueCV
04436                                 && fMaskAtmosSpecNueBarCV && fFitAtmosSpecNueBarCV
04437                                 && Configuration::Instance()->UsingAtmosMuonNeutrinosOnly()==false  
04438                                 && Configuration::Instance()->DoingNueSpectrumSystematic()==true
04439                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kCV, OscFit::kSpec ) );
04440     fFittingAtmosSpecNueBarCV  = ( fMaskAtmosSpecNueCV && fFitAtmosSpecNueCV
04441                                 && fMaskAtmosSpecNueBarCV && fFitAtmosSpecNueBarCV
04442                                 && Configuration::Instance()->UsingAtmosMuonNeutrinosOnly()==false
04443                                 && Configuration::Instance()->DoingNueSpectrumSystematic()==true  
04444                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kCV, OscFit::kSpec ) ); 
04445     fFittingAtmosSpecNuRock    = ( fMaskAtmosSpecNuRock && fFitAtmosSpecNuRock
04446                                 && fMaskAtmosSpecNuBarRock && fFitAtmosSpecNuBarRock
04447                                 && Configuration::Instance()->UsingContainedVertexOnly()==false 
04448                                 && Configuration::Instance()->DoingRockSpectrumSystematic()==true
04449                                 && TemplateGrid::Instance()->TouchAtmosRockMC()==true 
04450                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kRock, OscFit::kSpec ) );
04451     fFittingAtmosSpecNuBarRock = ( fMaskAtmosSpecNuRock && fFitAtmosSpecNuRock
04452                                 && fMaskAtmosSpecNuBarRock && fFitAtmosSpecNuBarRock
04453                                 && Configuration::Instance()->UsingContainedVertexOnly()==false 
04454                                 && Configuration::Instance()->DoingRockSpectrumSystematic()==true
04455                                 && TemplateGrid::Instance()->TouchAtmosRockMC()==true 
04456                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kRock, OscFit::kSpec ) );
04457     fFittingAtmosZenith        = ( fMaskAtmosZenith && fFitAtmosZenith 
04458                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kZenith )  );
04459     fFittingAtmosNumuTrkEn     = ( fMaskAtmosNumuTrkEn && fFitAtmosNumuTrkEn 
04460                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kTrkEn ) );
04461     fFittingAtmosNumuTrkEnExit = ( fMaskAtmosNumuTrkEnExit && fFitAtmosNumuTrkEnExit 
04462                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kTrkEnExit ) );
04463     fFittingAtmosNumuShwEn     = ( fMaskAtmosNumuShwEn && fFitAtmosNumuShwEn 
04464                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kShwEn ) );
04465     fFittingAtmosNueEnergy     = ( fMaskAtmosNueEnergy && fFitAtmosNueEnergy 
04466                                 && Configuration::Instance()->UsingAtmosMuonNeutrinosOnly()==false
04467                                 && Configuration::Instance()->DoingNueEnergySystematic()==true  
04468                                 && TemplateGrid::Instance()->TouchSystematic( OscFit::kAtmosData, OscFit::kNueEnergy ) );
04469   }
04470 
04471   // correlated systematics
04472   if( fCorrelatedSystematics ){
04473 
04474     if( Configuration::Instance()->GetExperiment()==OscFit::kMINOS ){
04475       if( UsingBeamData() ){
04476         fFittingBeamNumuTrkEnExit = 0;
04477         if( UsingAtmosData() ){
04478           fFittingAtmosNumuTrkEn = 0;
04479         }
04480       }
04481     }
04482 
04483     else if( Configuration::Instance()->GetExperiment()==OscFit::kLBNE ){
04484       if( UsingBeamData() ){
04485         if( UsingAtmosData() ){
04486           fFittingAtmosNumuTrkEn = 0;
04487           fFittingAtmosNumuTrkEnExit = 0;
04488           fFittingAtmosNumuShwEn = 0;
04489           fFittingAtmosNueEnergy = 0;
04490         }
04491       }
04492     }
04493   }
04494 
04495   // check whether fit should be run
04496   Bool_t runFit = 0;
04497 
04498   if( fFittingDmsq )               runFit = 1; 
04499   if( fFittingSinsq23 )            runFit = 1; 
04500   if( fFittingSinsq13 )            runFit = 1; 
04501   if( fFittingDeltaCP )            runFit = 1; 
04502   if( fFittingBeamNumuNorm )       runFit = 1; 
04503   if( fFittingBeamNumuNCBkg )      runFit = 1; 
04504   if( fFittingBeamNumuShwEn )      runFit = 1; 
04505   if( fFittingBeamNumuTrkEn )      runFit = 1; 
04506   if( fFittingBeamNumuTrkEnExit )  runFit = 1; 
04507   if( fFittingBeamNueNorm )        runFit = 1; 
04508   if( fFittingBeamNueNCBkg )       runFit = 1; 
04509   if( fFittingBeamNueEnergy )      runFit = 1; 
04510   if( fFittingAtmosNormCV )        runFit = 1;
04511   if( fFittingAtmosNormRock )      runFit = 1;
04512   if( fFittingAtmosChgCV )         runFit = 1;
04513   if( fFittingAtmosChgRock )       runFit = 1;
04514   if( fFittingAtmosNueNorm )       runFit = 1;
04515   if( fFittingAtmosNueRatio )      runFit = 1;
04516   if( fFittingAtmosNCBkg )         runFit = 1;
04517   if( fFittingAtmosSpecNumuCV )    runFit = 1;
04518   if( fFittingAtmosSpecNumuBarCV ) runFit = 1;
04519   if( fFittingAtmosSpecNueCV )     runFit = 1;
04520   if( fFittingAtmosSpecNueBarCV )  runFit = 1;
04521   if( fFittingAtmosSpecNuRock )    runFit = 1;
04522   if( fFittingAtmosSpecNuBarRock ) runFit = 1;
04523   if( fFittingAtmosZenith )        runFit = 1;
04524   if( fFittingAtmosNumuTrkEn )     runFit = 1;
04525   if( fFittingAtmosNumuTrkEnExit ) runFit = 1;
04526   if( fFittingAtmosNumuShwEn )     runFit = 1;
04527   if( fFittingAtmosNueEnergy )     runFit = 1;
04528 
04529  
04530   // default parameters
04531   Double_t osc_dmsq              = fOscDmsq;
04532   Double_t osc_sinsq23           = fOscSinsq23;
04533   Double_t osc_sinsq13           = fOscSinsq13;
04534   Double_t osc_deltaCP           = fOscDeltaCP;
04535   Double_t beam_numu_norm        = fBeamNumuNorm;
04536   Double_t beam_numu_ncbkg       = fBeamNumuNCBkg;
04537   Double_t beam_numu_shwen       = fBeamNumuShwEn;
04538   Double_t beam_numu_trken       = fBeamNumuTrkEn;
04539   Double_t beam_numu_trken_exit  = fBeamNumuTrkEnExit;
04540   Double_t beam_nue_norm         = fBeamNueNorm;
04541   Double_t beam_nue_ncbkg        = fBeamNueNCBkg;
04542   Double_t beam_nue_energy       = fBeamNueEnergy;
04543   Double_t atmos_norm_cv         = fAtmosNormCV;
04544   Double_t atmos_norm_rock       = fAtmosNormRock; 
04545   Double_t atmos_chg_cv          = fAtmosChgCV;
04546   Double_t atmos_chg_rock        = fAtmosChgRock; 
04547   Double_t atmos_nue_norm        = fAtmosNueNorm;  
04548   Double_t atmos_nue_ratio       = fAtmosNueRatio;   
04549   Double_t atmos_ncbkg           = fAtmosNCBkg;
04550   Double_t atmos_spec_cv_numu    = fAtmosSpecNumuCV;  
04551   Double_t atmos_spec_cv_numubar = fAtmosSpecNumuBarCV;
04552   Double_t atmos_spec_cv_nue     = fAtmosSpecNueCV;  
04553   Double_t atmos_spec_cv_nuebar  = fAtmosSpecNueBarCV;
04554   Double_t atmos_spec_rock_nu    = fAtmosSpecNuRock;  
04555   Double_t atmos_spec_rock_nubar = fAtmosSpecNuBarRock;
04556   Double_t atmos_zenith          = fAtmosZenith;
04557   Double_t atmos_numu_trken      = fAtmosNumuTrkEn;   
04558   Double_t atmos_numu_trken_exit = fAtmosNumuTrkEnExit;   
04559   Double_t atmos_numu_shwen      = fAtmosNumuShwEn;
04560   Double_t atmos_nue_energy      = fAtmosNueEnergy;
04561 
04562 
04563   Double_t osc_dmsq_err              = 0.0;
04564   Double_t osc_sinsq23_err           = 0.0;
04565   Double_t osc_sinsq13_err           = 0.0;
04566   Double_t osc_deltaCP_err           = 0.0;
04567   Double_t beam_numu_norm_err        = 0.0;
04568   Double_t beam_numu_ncbkg_err       = 0.0;
04569   Double_t beam_numu_shwen_err       = 0.0;
04570   Double_t beam_numu_trken_err       = 0.0;
04571   Double_t beam_numu_trken_exit_err  = 0.0;
04572   Double_t beam_nue_norm_err         = 0.0;
04573   Double_t beam_nue_ncbkg_err        = 0.0;
04574   Double_t beam_nue_energy_err       = 0.0;
04575   Double_t atmos_norm_cv_err         = 0.0;
04576   Double_t atmos_norm_rock_err       = 0.0;
04577   Double_t atmos_chg_cv_err          = 0.0;
04578   Double_t atmos_chg_rock_err        = 0.0;
04579   Double_t atmos_nue_norm_err        = 0.0;
04580   Double_t atmos_nue_ratio_err       = 0.0;
04581   Double_t atmos_ncbkg_err           = 0.0;
04582   Double_t atmos_spec_cv_numu_err    = 0.0;
04583   Double_t atmos_spec_cv_numubar_err = 0.0; 
04584   Double_t atmos_spec_cv_nue_err     = 0.0;
04585   Double_t atmos_spec_cv_nuebar_err  = 0.0;
04586   Double_t atmos_spec_rock_nu_err    = 0.0;
04587   Double_t atmos_spec_rock_nubar_err = 0.0;
04588   Double_t atmos_zenith_err          = 0.0;
04589   Double_t atmos_numu_trken_err      = 0.0;
04590   Double_t atmos_numu_trken_exit_err = 0.0;
04591   Double_t atmos_numu_shwen_err      = 0.0;
04592   Double_t atmos_nue_energy_err      = 0.0;
04593 
04594 
04595   // nominal result
04596   Double_t outputLnL = 0.0;
04597 
04598   GetLnL( osc_dmsq,           osc_sinsq23,
04599           osc_sinsq13,        osc_deltaCP,
04600           beam_numu_norm,     beam_numu_ncbkg, 
04601           beam_numu_shwen,    beam_numu_trken, 
04602           beam_numu_trken_exit, 
04603           beam_nue_norm,      beam_nue_ncbkg, 
04604           beam_nue_energy,
04605           atmos_norm_cv,      atmos_norm_rock,
04606           atmos_chg_cv,       atmos_chg_rock,
04607           atmos_nue_norm,     atmos_nue_ratio,      
04608           atmos_ncbkg,
04609           atmos_spec_cv_numu, atmos_spec_cv_numubar,
04610           atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
04611           atmos_spec_rock_nu, atmos_spec_rock_nubar,
04612           atmos_zenith,
04613           atmos_numu_trken,   atmos_numu_trken_exit, 
04614           atmos_numu_shwen,   atmos_nue_energy,
04615           outputLnL );
04616 
04617   // Run Minuit
04618   if( runFit ){
04619 
04620     // which hierarchy
04621     Bool_t isNormalHierarchy = 0;
04622     Bool_t isLowerSinsq23    = 0;
04623     Bool_t isLowerDeltaCP    = 0;
04624 
04625     if( osc_dmsq>=0.0 )    isNormalHierarchy = 1;
04626     else                   isNormalHierarchy = 0;
04627 
04628     if( osc_sinsq23<=0.5 ) isLowerSinsq23 = 1;
04629     else                   isLowerSinsq23 = 0;
04630 
04631     if( osc_deltaCP<=TMath::Pi() ) isLowerDeltaCP = 1;
04632     else                           isLowerDeltaCP = 0;
04633 
04634     // set up fit
04635     Int_t err   = 0;
04636     Int_t flag  = 0;
04637     Int_t npari = 0;
04638     Int_t nparx = 0;
04639     Int_t istat = 0;
04640     Double_t lnl = 0.0;
04641     Double_t fedm = 0.0;
04642     Double_t errdef = 0.0;
04643 
04644     Double_t* arglist = new Double_t[10];
04645 
04646     // Reset Counter
04647     this->reset_counter();
04648 
04649     // Reset Fit
04650     fMinuit->mncler();
04651 
04652     // Set Likelihood Function
04653     fMinuit->SetFCN( ThreeFlavourLikelihoodFunction );
04654 
04655     // Log-Likelihood
04656     arglist[0] = 0.5; // 0.5: log-likelihood function
04657                       // 1.0: chi-squared function
04658     fMinuit->mnexcm("SET STR",arglist,1,err);
04659 
04660     // Set Strategy
04661     arglist[0] = 1;  // 1: standard minimization
04662                      // 2: try to improve minimum (also: better errors)
04663     fMinuit->mnexcm("SET STR",arglist,1,err);
04664 
04665 
04666     // Set Fit Parameters
04667     if( fFittingDmsq ){
04668       if( isNormalHierarchy )      fMinuit->mnparm(0,  "dmsq",            osc_dmsq,         0.0002,  0.0, +0.1, err); 
04669       else                         fMinuit->mnparm(0,  "dmsq",            osc_dmsq,         0.0002, -0.1, -0.0, err); 
04670     }
04671 
04672     if( fFittingSinsq23 ){
04673       if( fSplittingSinsq23==false ){
04674                                    fMinuit->mnparm(1,  "sinsq23",         osc_sinsq23,      0.125,   0.0, +1.0, err);
04675       }
04676       else{
04677         if( fSpecialSplitSinsq23==false ){
04678           if( isLowerSinsq23 )     fMinuit->mnparm(1,  "sinsq23",         osc_sinsq23,      0.125,   0.0,          +0.5-fEpsilon, err);
04679           else                     fMinuit->mnparm(1,  "sinsq23",         osc_sinsq23,      0.125,  +0.5+fEpsilon, +1.0, err);
04680         }
04681         else{
04682           if( isLowerSinsq23 )     fMinuit->mnparm(1,  "sinsq23",         osc_sinsq23,      0.125,   0.0,          +0.5-fEpsilon, err);
04683           else                     fMinuit->mnparm(1,  "sinsq23",         osc_sinsq23,      0.125,  +0.5+fZeta,    +1.0, err);
04684         }
04685       }
04686     }
04687 
04688     if( fFittingSinsq13 )          fMinuit->mnparm(2,  "sinsq13",         osc_sinsq13,      0.005,  0.0, +1.0, err);
04689 
04690     if( fFittingDeltaCP ){
04691       if( fSplittingDeltaCP==false ){
04692                                    fMinuit->mnparm(3,  "deltaCP",         osc_deltaCP,      0.5*TMath::Pi(), 0.0, +2.0*TMath::Pi(), err);
04693       }
04694       else{
04695         if( isLowerDeltaCP )       fMinuit->mnparm(3,  "deltaCP",         osc_deltaCP,      0.5*TMath::Pi(), 0.0, +1.0*TMath::Pi()-fEpsilon, err);
04696         else                       fMinuit->mnparm(3,  "deltaCP",         osc_deltaCP,      0.5*TMath::Pi(), +1.0*TMath::Pi()+fEpsilon, +2.0*TMath::Pi(), err);
04697       }
04698     }
04699 
04700     if( UsingBeamData() ){
04701       if( fFittingBeamNumuNorm )       fMinuit->mnparm(4,  "beam_numu_norm",       beam_numu_norm,        1.0,   -3.0, +3.0, err);
04702       if( fFittingBeamNumuNCBkg )      fMinuit->mnparm(5,  "beam_numu_ncbkg",      beam_numu_ncbkg,       1.0,   -2.5, +2.5, err);
04703       if( fFittingBeamNumuShwEn )      fMinuit->mnparm(6,  "beam_numu_shwen",      beam_numu_shwen,       1.0,   -2.5, +2.5, err);
04704       if( fFittingBeamNumuTrkEn )      fMinuit->mnparm(7,  "beam_numu_trken",      beam_numu_trken,       1.0,   -2.5, +2.5, err); 
04705       if( fFittingBeamNumuTrkEnExit )  fMinuit->mnparm(8,  "beam_numu_trken_exit", beam_numu_trken_exit,  1.0,   -2.5, +2.5, err); 
04706       if( fFittingBeamNueNorm )        fMinuit->mnparm(9,  "beam_nue_norm",        beam_nue_norm,         1.0,   -3.0, +3.0, err);
04707       if( fFittingBeamNueNCBkg )       fMinuit->mnparm(10, "beam_nue_ncbkg",       beam_nue_ncbkg,        1.0,   -2.5, +2.5, err);
04708       if( fFittingBeamNueEnergy )      fMinuit->mnparm(11, "beam_nue_energy",      beam_nue_energy,       1.0,   -2.5, +2.5, err);
04709     }
04710 
04711     if( UsingAtmosData() ){
04712       if( fFittingAtmosNormCV )        fMinuit->mnparm(12, "atmos_norm_cv",        atmos_norm_cv,         1.0,   -3.0, +3.0, err);
04713       if( fFittingAtmosNormRock )      fMinuit->mnparm(13, "atmos_norm_rock",      atmos_norm_rock,       1.0,   -3.0, +3.0, err);
04714       if( fFittingAtmosChgCV )         fMinuit->mnparm(14, "atmos_chg_cv",         atmos_chg_cv,          1.0,   -2.5, +2.5, err);
04715       if( fFittingAtmosChgRock )       fMinuit->mnparm(15, "atmos_chg_rock",       atmos_chg_rock,        1.0,   -2.5, +2.5, err);
04716       if( fFittingAtmosNueNorm )       fMinuit->mnparm(16, "atmos_nue_norm",       atmos_nue_norm,        1.0,   -2.5, +2.5, err);
04717       if( fFittingAtmosNueRatio )      fMinuit->mnparm(17, "atmos_nue_ratio",      atmos_nue_ratio,       1.0,   -2.5, +2.5, err);
04718       if( fFittingAtmosNCBkg )         fMinuit->mnparm(18, "atmos_ncbkg",          atmos_ncbkg,           1.0,   -2.5, +2.5, err);
04719       if( fFittingAtmosSpecNumuCV )    fMinuit->mnparm(19, "atmos_spec_cv_numu",   atmos_spec_cv_numu,    1.0,   -2.5, +2.5, err);
04720       if( fFittingAtmosSpecNumuBarCV ) fMinuit->mnparm(20, "atmos_spec_cv_numubar",atmos_spec_cv_numubar, 1.0,   -2.5, +2.5, err);
04721       if( fFittingAtmosSpecNueCV )     fMinuit->mnparm(21, "atmos_spec_cv_nue",    atmos_spec_cv_nue,     1.0,   -2.5, +2.5, err);
04722       if( fFittingAtmosSpecNueBarCV )  fMinuit->mnparm(22, "atmos_spec_cv_nuebar", atmos_spec_cv_nuebar,  1.0,   -2.5, +2.5, err);
04723       if( fFittingAtmosSpecNuRock )    fMinuit->mnparm(23, "atmos_spec_rock_nu",   atmos_spec_rock_nu,    1.0,   -2.5, +2.5, err);
04724       if( fFittingAtmosSpecNuBarRock ) fMinuit->mnparm(24, "atmos_spec_rock_nubar",atmos_spec_rock_nubar, 1.0,   -2.5, +2.5, err);
04725       if( fFittingAtmosZenith )        fMinuit->mnparm(25, "atmos_zenith",         atmos_zenith,          1.0,   -2.5, +2.5, err);
04726       if( fFittingAtmosNumuTrkEn )     fMinuit->mnparm(26, "atmos_numu_trken",     atmos_numu_trken,      1.0,   -2.5, +2.5, err);
04727       if( fFittingAtmosNumuTrkEnExit ) fMinuit->mnparm(27, "atmos_numu_trken_exit",atmos_numu_trken_exit, 1.0,   -2.5, +2.5, err);
04728       if( fFittingAtmosNumuShwEn )     fMinuit->mnparm(28, "atmos_numu_shwen",     atmos_numu_shwen,      1.0,   -2.5, +2.5, err); 
04729       if( fFittingAtmosNueEnergy )     fMinuit->mnparm(29, "atmos_nue_energy",     atmos_nue_energy,      1.0,   -2.5, +2.5, err); 
04730     }
04731  
04732     // Run The Fit
04733     if( fUseSimplex ){
04734       if( fDebug ) std::cout << "  Fitting With Minuit (Simplex) " << std::endl;
04735       fMinuit->mnsimp(); flag = 0;
04736     }
04737     else{
04738       if( fDebug ) std::cout << "  Fitting With Minuit (Migrad) " << std::endl;
04739       flag = fMinuit->Migrad();
04740     }
04741 
04742     if( fMinuit->GetNumPars()>0 ){
04743       fMinuitStatus = flag;
04744     }
04745 
04746     // Get Fitted Parameters
04747     if( fFittingDmsq )               fMinuit->GetParameter(0,  osc_dmsq,              osc_dmsq_err);
04748     if( fFittingSinsq23 )            fMinuit->GetParameter(1,  osc_sinsq23,           osc_sinsq23_err);
04749     if( fFittingSinsq13 )            fMinuit->GetParameter(2,  osc_sinsq13,           osc_sinsq13_err);
04750     if( fFittingDeltaCP )            fMinuit->GetParameter(3,  osc_deltaCP,           osc_deltaCP_err);
04751 
04752     if( fFittingBeamNumuNorm )       fMinuit->GetParameter(4,  beam_numu_norm,        beam_numu_norm_err);
04753     if( fFittingBeamNumuNCBkg )      fMinuit->GetParameter(5,  beam_numu_ncbkg,       beam_numu_ncbkg_err);
04754     if( fFittingBeamNumuShwEn )      fMinuit->GetParameter(6,  beam_numu_shwen,       beam_numu_shwen_err);
04755     if( fFittingBeamNumuTrkEn )      fMinuit->GetParameter(7,  beam_numu_trken,       beam_numu_trken_err);  
04756     if( fFittingBeamNumuTrkEnExit )  fMinuit->GetParameter(8,  beam_numu_trken_exit,  beam_numu_trken_exit_err); 
04757     if( fFittingBeamNueNorm )        fMinuit->GetParameter(9,  beam_nue_norm,         beam_nue_norm_err);
04758     if( fFittingBeamNueNCBkg )       fMinuit->GetParameter(10, beam_nue_ncbkg,        beam_nue_ncbkg_err);
04759     if( fFittingBeamNueEnergy )      fMinuit->GetParameter(11, beam_nue_energy,       beam_nue_energy_err); 
04760     if( fFittingAtmosNormCV )        fMinuit->GetParameter(12, atmos_norm_cv ,        atmos_norm_cv_err);
04761     if( fFittingAtmosNormRock )      fMinuit->GetParameter(13, atmos_norm_rock,       atmos_norm_rock_err);
04762     if( fFittingAtmosChgCV )         fMinuit->GetParameter(14, atmos_chg_cv,          atmos_chg_cv_err);
04763     if( fFittingAtmosChgRock )       fMinuit->GetParameter(15, atmos_chg_rock,        atmos_chg_rock_err);
04764     if( fFittingAtmosNueNorm )       fMinuit->GetParameter(16, atmos_nue_norm,        atmos_nue_norm_err);
04765     if( fFittingAtmosNueRatio )      fMinuit->GetParameter(17, atmos_nue_ratio,       atmos_nue_ratio_err);
04766     if( fFittingAtmosNCBkg )         fMinuit->GetParameter(18, atmos_ncbkg,           atmos_ncbkg_err);
04767     if( fFittingAtmosSpecNumuCV )    fMinuit->GetParameter(19, atmos_spec_cv_numu,    atmos_spec_cv_numu_err);
04768     if( fFittingAtmosSpecNumuBarCV ) fMinuit->GetParameter(20, atmos_spec_cv_numubar, atmos_spec_cv_numubar_err); 
04769     if( fFittingAtmosSpecNueCV )     fMinuit->GetParameter(21, atmos_spec_cv_nue,     atmos_spec_cv_nue_err);
04770     if( fFittingAtmosSpecNueBarCV )  fMinuit->GetParameter(22, atmos_spec_cv_nuebar,  atmos_spec_cv_nuebar_err); 
04771     if( fFittingAtmosSpecNuRock )    fMinuit->GetParameter(23, atmos_spec_rock_nu,    atmos_spec_rock_nu_err);
04772     if( fFittingAtmosSpecNuBarRock ) fMinuit->GetParameter(24, atmos_spec_rock_nubar, atmos_spec_rock_nubar_err);
04773     if( fFittingAtmosZenith )        fMinuit->GetParameter(25, atmos_zenith,          atmos_zenith_err);
04774     if( fFittingAtmosNumuTrkEn )     fMinuit->GetParameter(26, atmos_numu_trken,      atmos_numu_trken_err);
04775     if( fFittingAtmosNumuTrkEnExit ) fMinuit->GetParameter(27, atmos_numu_trken_exit, atmos_numu_trken_exit_err);
04776     if( fFittingAtmosNumuShwEn )     fMinuit->GetParameter(28, atmos_numu_shwen,      atmos_numu_shwen_err);
04777     if( fFittingAtmosNueEnergy )     fMinuit->GetParameter(29, atmos_nue_energy,      atmos_nue_energy_err);
04778     
04779 
04780     // get best fit log-likelihood
04781     fMinuit->mnstat(lnl,fedm,errdef,npari,nparx,istat);
04782 
04783     outputLnL = lnl;
04784 
04785     delete [] arglist;
04786   }
04787 
04788   // Print Fitted Parameters
04789   if( fDebug ){
04790     std::cout << "  Iterations: " << std::endl;
04791     std::cout << "   Ctr=" << this->get_counter() << std::endl;
04792     std::cout << "  Oscillations: " << std::endl;
04793     std::cout << "   osc_dmsq:         " << osc_dmsq    << "\t+/-\t" << osc_dmsq_err   << std::endl;
04794     std::cout << "   osc_sinsq23:      " << osc_sinsq23 << "\t+/-\t" << osc_sinsq23_err  << std::endl;
04795     std::cout << "   osc_sinsq13:      " << osc_sinsq13 << "\t+/-\t" << osc_sinsq13_err  << std::endl;
04796     std::cout << "   osc_deltaCP:      " << osc_deltaCP << "\t+/-\t" << osc_deltaCP_err << std::endl;
04797     if( UsingBeamData() ){
04798       std::cout << "  Beam Systematics:  " << std::endl;
04799       std::cout << "   beam_numu_norm:        " << beam_numu_norm        << "\t+/-\t" << beam_numu_norm_err        << std::endl;
04800       std::cout << "   beam_numu_ncbkg:       " << beam_numu_ncbkg       << "\t+/-\t" << beam_numu_ncbkg_err       << std::endl;
04801       std::cout << "   beam_numu_shwen:       " << beam_numu_shwen       << "\t+/-\t" << beam_numu_shwen_err       << std::endl;
04802       std::cout << "   beam_numu_trken:       " << beam_numu_trken       << "\t+/-\t" << beam_numu_trken_err       << std::endl;
04803       std::cout << "   beam_numu_trken_exit:  " << beam_numu_trken_exit  << "\t+/-\t" << beam_numu_trken_exit_err  << std::endl;
04804       std::cout << "   beam_nue_norm:         " << beam_nue_norm         << "\t+/-\t" << beam_nue_norm_err         << std::endl;
04805       std::cout << "   beam_nue_ncbkg:        " << beam_nue_ncbkg        << "\t+/-\t" << beam_nue_ncbkg_err        << std::endl;
04806       std::cout << "   beam_nue_energy:       " << beam_nue_energy       << "\t+/-\t" << beam_nue_energy_err       << std::endl;
04807     }
04808     if( UsingAtmosData() ){
04809       std::cout << "  Atmos Systematics:      " << std::endl;
04810       std::cout << "   atmos_norm_cv:         " << atmos_norm_cv         << "\t+/-\t" << atmos_norm_cv_err         << std::endl;
04811       std::cout << "   atmos_norm_rock:       " << atmos_norm_rock       << "\t+/-\t" << atmos_norm_rock_err       << std::endl; 
04812       std::cout << "   atmos_chg_cv:          " << atmos_chg_cv          << "\t+/-\t" << atmos_chg_cv_err          << std::endl;
04813       std::cout << "   atmos_chg_rock:        " << atmos_chg_rock        << "\t+/-\t" << atmos_chg_rock_err        << std::endl;
04814       std::cout << "   atmos_nue_norm:        " << atmos_nue_norm        << "\t+/-\t" << atmos_nue_norm_err        << std::endl;
04815       std::cout << "   atmos_nue_ratio:       " << atmos_nue_ratio       << "\t+/-\t" << atmos_nue_ratio_err       << std::endl;
04816       std::cout << "   atmos_ncbkg:           " << atmos_ncbkg           << "\t+/-\t" << atmos_ncbkg_err           << std::endl;
04817       std::cout << "   atmos_spec_cv_numu:    " << atmos_spec_cv_numu    << "\t+/-\t" << atmos_spec_cv_numu_err    << std::endl;
04818       std::cout << "   atmos_spec_cv_numubar: " << atmos_spec_cv_numubar << "\t+/-\t" << atmos_spec_cv_numubar_err << std::endl;  
04819       std::cout << "   atmos_spec_cv_nue:     " << atmos_spec_cv_nue     << "\t+/-\t" << atmos_spec_cv_nue_err     << std::endl;
04820       std::cout << "   atmos_spec_cv_nuebar:  " << atmos_spec_cv_nuebar  << "\t+/-\t" << atmos_spec_cv_nuebar_err  << std::endl;   
04821       std::cout << "   atmos_spec_rock_nu:    " << atmos_spec_rock_nu    << "\t+/-\t" << atmos_spec_rock_nu_err    << std::endl;
04822       std::cout << "   atmos_spec_rock_nubar: " << atmos_spec_rock_nubar << "\t+/-\t" << atmos_spec_rock_nubar_err << std::endl;
04823       std::cout << "   atmos_zenith:          " << atmos_zenith          << "\t+/-\t" << atmos_zenith_err          << std::endl;
04824       std::cout << "   atmos_numu_trken:      " << atmos_numu_trken      << "\t+/-\t" << atmos_numu_trken_err      << std::endl;
04825       std::cout << "   atmos_numu_trken_exit: " << atmos_numu_trken_exit << "\t+/-\t" << atmos_numu_trken_exit_err << std::endl;
04826       std::cout << "   atmos_numu_shwen:      " << atmos_numu_shwen      << "\t+/-\t" << atmos_numu_shwen_err      << std::endl;
04827       std::cout << "   atmos_nue_energy:      " << atmos_nue_energy      << "\t+/-\t" << atmos_nue_energy_err      << std::endl;
04828     }
04829     std::cout << "  Likelihood: " << std::endl;
04830     std::cout << "   LnL=" << outputLnL << std::endl;
04831   }
04832 
04833   // Set Fitted Parameters
04834   fOscDmsq            = osc_dmsq;
04835   fOscSinsq23         = osc_sinsq23;
04836   fOscSinsq13         = osc_sinsq13;
04837   fOscDeltaCP         = osc_deltaCP;
04838   fBeamNumuNorm       = beam_numu_norm;
04839   fBeamNumuNCBkg      = beam_numu_ncbkg;
04840   fBeamNumuShwEn      = beam_numu_shwen;
04841   fBeamNumuTrkEn      = beam_numu_trken;
04842   fBeamNumuTrkEnExit  = beam_numu_trken_exit;
04843   fBeamNueNorm        = beam_nue_norm;
04844   fBeamNueNCBkg       = beam_nue_ncbkg;
04845   fBeamNueEnergy      = beam_nue_energy;
04846   fAtmosNormCV        = atmos_norm_cv;
04847   fAtmosNormRock      = atmos_norm_rock;
04848   fAtmosChgCV         = atmos_chg_cv;
04849   fAtmosChgRock       = atmos_chg_rock;
04850   fAtmosNueNorm       = atmos_nue_norm;
04851   fAtmosNueRatio      = atmos_nue_ratio;
04852   fAtmosNCBkg         = atmos_ncbkg;
04853   fAtmosSpecNumuCV    = atmos_spec_cv_numu;
04854   fAtmosSpecNumuBarCV = atmos_spec_cv_numubar; 
04855   fAtmosSpecNueCV     = atmos_spec_cv_nue;
04856   fAtmosSpecNueBarCV  = atmos_spec_cv_nuebar; 
04857   fAtmosSpecNuRock    = atmos_spec_rock_nu;
04858   fAtmosSpecNuBarRock = atmos_spec_rock_nubar;
04859   fAtmosZenith        = atmos_zenith;
04860   fAtmosNumuTrkEn     = atmos_numu_trken;
04861   fAtmosNumuTrkEnExit = atmos_numu_trken_exit;
04862   fAtmosNumuShwEn     = atmos_numu_shwen;
04863   fAtmosNueEnergy     = atmos_nue_energy;
04864 
04865   fOutputLnL          = outputLnL;
04866   
04867   return;
04868 }

void ThreeFlavourFitter::RunFitWithMinuit ( Double_t  input_dmsq,
Double_t  input_sinsq23,
Double_t  input_sinsq13,
Double_t  input_deltaCP 
) [private]

Definition at line 4100 of file ThreeFlavourFitter.cxx.

References fAtmosChgCV, fAtmosChgRock, fAtmosNCBkg, fAtmosNormCV, fAtmosNormRock, fAtmosNueEnergy, fAtmosNueNorm, fAtmosNueRatio, fAtmosNumuShwEn, fAtmosNumuTrkEn, fAtmosNumuTrkEnExit, fAtmosSpecNuBarRock, fAtmosSpecNueBarCV, fAtmosSpecNueCV, fAtmosSpecNumuBarCV, fAtmosSpecNumuCV, fAtmosSpecNuRock, fAtmosZenith, fBeamNueEnergy, fBeamNueNCBkg, fBeamNueNorm, fBeamNumuNCBkg, fBeamNumuNorm, fBeamNumuShwEn, fBeamNumuTrkEn, fBeamNumuTrkEnExit, fBestFitAtmosChgCV, fBestFitAtmosChgRock, fBestFitAtmosNCBkg, fBestFitAtmosNormCV, fBestFitAtmosNormRock, fBestFitAtmosNueEnergy, fBestFitAtmosNueNorm, fBestFitAtmosNueRatio, fBestFitAtmosNumuShwEn, fBestFitAtmosNumuTrkEn, fBestFitAtmosNumuTrkEnExit, fBestFitAtmosSpecNuBarRock, fBestFitAtmosSpecNueBarCV, fBestFitAtmosSpecNueCV, fBestFitAtmosSpecNumuBarCV, fBestFitAtmosSpecNumuCV, fBestFitAtmosSpecNuRock, fBestFitAtmosZenith, fBestFitBeamNueEnergy, fBestFitBeamNueNCBkg, fBestFitBeamNueNorm, fBestFitBeamNumuNCBkg, fBestFitBeamNumuNorm, fBestFitBeamNumuShwEn, fBestFitBeamNumuTrkEn, fBestFitBeamNumuTrkEnExit, fBestFitLnL, fBestFitOscDeltaCP, fBestFitOscDmsq, fBestFitOscSinsq13, fBestFitOscSinsq23, fDebug, fOscDeltaCP, fOscDmsq, fOscSinsq13, fOscSinsq23, fOutputLnL, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, and RunFitWithMinuitInSteps().

04101 {
04102   if( fDebug ){
04103     std::cout << " *** ThreeFlavourFitter::RunFitWithMinuit(...) *** " << std::endl;
04104     std::cout << "  input_dmsq    = " << input_dmsq << std::endl;
04105     std::cout << "  input_sinsq23 = " << input_sinsq23 << std::endl;
04106     std::cout << "  input_sinsq13 = " << input_sinsq13 << std::endl;
04107     std::cout << "  input_deltaCP = " << input_deltaCP << std::endl;
04108   }
04109 
04110   fOscDmsq     = input_dmsq;
04111   fOscSinsq23  = input_sinsq23;
04112   fOscSinsq13  = input_sinsq13;
04113   fOscDeltaCP  = input_deltaCP; 
04114 
04115   fBeamNumuNorm       = fSeedBeamNumuNorm;
04116   fBeamNumuNCBkg      = fSeedBeamNumuNCBkg;
04117   fBeamNumuShwEn      = fSeedBeamNumuShwEn;
04118   fBeamNumuTrkEn      = fSeedBeamNumuTrkEn;
04119   fBeamNumuTrkEnExit  = fSeedBeamNumuTrkEnExit;
04120   fBeamNueNorm        = fSeedBeamNueNorm;
04121   fBeamNueNCBkg       = fSeedBeamNueNCBkg;
04122   fBeamNueEnergy      = fSeedBeamNueEnergy;
04123   fAtmosNormCV        = fSeedAtmosNormCV;
04124   fAtmosNormRock      = fSeedAtmosNormRock;
04125   fAtmosChgCV         = fSeedAtmosChgCV;
04126   fAtmosChgRock       = fSeedAtmosChgRock;
04127   fAtmosNueNorm       = fSeedAtmosNueNorm;
04128   fAtmosNueRatio      = fSeedAtmosNueRatio;
04129   fAtmosNCBkg         = fSeedAtmosNCBkg;
04130   fAtmosSpecNumuCV    = fSeedAtmosSpecNumuCV;
04131   fAtmosSpecNumuBarCV = fSeedAtmosSpecNumuBarCV; 
04132   fAtmosSpecNueCV     = fSeedAtmosSpecNueCV;
04133   fAtmosSpecNueBarCV  = fSeedAtmosSpecNueBarCV; 
04134   fAtmosSpecNuRock    = fSeedAtmosSpecNuRock;
04135   fAtmosSpecNuBarRock = fSeedAtmosSpecNuBarRock;
04136   fAtmosZenith        = fSeedAtmosZenith;
04137   fAtmosNumuTrkEn     = fSeedAtmosNumuTrkEn;
04138   fAtmosNumuTrkEnExit = fSeedAtmosNumuTrkEnExit;
04139   fAtmosNumuShwEn     = fSeedAtmosNumuShwEn;
04140   fAtmosNueEnergy     = fSeedAtmosNueEnergy;
04141 
04142   RunFitWithMinuitInSteps();
04143 
04144   if( fOutputLnL<fBestFitLnL ){
04145     fBestFitOscDmsq            = fOscDmsq;
04146     fBestFitOscSinsq23         = fOscSinsq23;
04147     fBestFitOscSinsq13         = fOscSinsq13;
04148     fBestFitOscDeltaCP         = fOscDeltaCP;
04149     fBestFitBeamNumuNorm       = fBeamNumuNorm;
04150     fBestFitBeamNumuNCBkg      = fBeamNumuNCBkg;
04151     fBestFitBeamNumuShwEn      = fBeamNumuShwEn;
04152     fBestFitBeamNumuTrkEn      = fBeamNumuTrkEn;
04153     fBestFitBeamNumuTrkEnExit  = fBeamNumuTrkEnExit;
04154     fBestFitBeamNueNorm        = fBeamNueNorm;
04155     fBestFitBeamNueNCBkg       = fBeamNueNCBkg;
04156     fBestFitBeamNueEnergy      = fBeamNueEnergy;
04157     fBestFitAtmosNormCV        = fAtmosNormCV;
04158     fBestFitAtmosNormRock      = fAtmosNormRock;
04159     fBestFitAtmosChgCV         = fAtmosChgCV;
04160     fBestFitAtmosChgRock       = fAtmosChgRock;
04161     fBestFitAtmosNueNorm       = fAtmosNueNorm;
04162     fBestFitAtmosNueRatio      = fAtmosNueRatio;
04163     fBestFitAtmosNCBkg         = fAtmosNCBkg;
04164     fBestFitAtmosSpecNumuCV    = fAtmosSpecNumuCV;
04165     fBestFitAtmosSpecNumuBarCV = fAtmosSpecNumuBarCV;
04166     fBestFitAtmosSpecNueCV     = fAtmosSpecNueCV;
04167     fBestFitAtmosSpecNueBarCV  = fAtmosSpecNueBarCV;
04168     fBestFitAtmosSpecNuRock    = fAtmosSpecNuRock;
04169     fBestFitAtmosSpecNuBarRock = fAtmosSpecNuBarRock;
04170     fBestFitAtmosZenith        = fAtmosZenith;
04171     fBestFitAtmosNumuTrkEn     = fAtmosNumuTrkEn;
04172     fBestFitAtmosNumuTrkEnExit = fAtmosNumuTrkEnExit;
04173     fBestFitAtmosNumuShwEn     = fAtmosNumuShwEn;
04174     fBestFitAtmosNueEnergy     = fAtmosNueEnergy;
04175     fBestFitLnL                = fOutputLnL;
04176   }
04177 }

void ThreeFlavourFitter::RunFitWithMinuitInSteps (  )  [private]

Definition at line 4179 of file ThreeFlavourFitter.cxx.

References fDebug, fMaskAtmosChgCV, fMaskAtmosChgRock, fMaskAtmosNCBkg, fMaskAtmosNormCV, fMaskAtmosNormRock, fMaskAtmosNueEnergy, fMaskAtmosNueNorm, fMaskAtmosNueRatio, fMaskAtmosNumuShwEn, fMaskAtmosNumuTrkEn, fMaskAtmosNumuTrkEnExit, fMaskAtmosSpecNuBarRock, fMaskAtmosSpecNueBarCV, fMaskAtmosSpecNueCV, fMaskAtmosSpecNumuBarCV, fMaskAtmosSpecNumuCV, fMaskAtmosSpecNuRock, fMaskAtmosZenith, fMaskBeamNueEnergy, fMaskBeamNueNCBkg, fMaskBeamNueNorm, fMaskBeamNumuNCBkg, fMaskBeamNumuNorm, fMaskBeamNumuShwEn, fMaskBeamNumuTrkEn, fMaskBeamNumuTrkEnExit, fMaskDeltaCP, fMaskDmsq, fMaskSinsq13, fMaskSinsq23, fMinuitStatus, fUseSimplex, and RunFitWithMinuit().

Referenced by RunFitWithMinuit().

04180 {
04181   if( fDebug ){ std::cout << " *** ThreeFlavourFitter::RunFitWithMinuitInSteps() *** " << std::endl; }
04182 
04183   // (0) initialisation
04184   fMinuitStatus = 999;
04185 
04186   // (1) oscillations + normalisations
04187   fMaskDmsq               = 1;
04188   fMaskSinsq23            = 1;
04189   fMaskSinsq13            = 1;
04190   fMaskDeltaCP            = 1;
04191   fMaskBeamNumuNorm       = 1;
04192   fMaskBeamNumuNCBkg      = 0;
04193   fMaskBeamNumuShwEn      = 0;
04194   fMaskBeamNumuTrkEn      = 0;
04195   fMaskBeamNumuTrkEnExit  = 0;  
04196   fMaskBeamNueNorm        = 1;
04197   fMaskBeamNueNCBkg       = 0;
04198   fMaskBeamNueEnergy      = 0;
04199   fMaskAtmosNormCV        = 1;
04200   fMaskAtmosNormRock      = 1;
04201   fMaskAtmosChgCV         = 0;
04202   fMaskAtmosChgRock       = 0;
04203   fMaskAtmosNueNorm       = 0;
04204   fMaskAtmosNueRatio      = 0;
04205   fMaskAtmosNCBkg         = 0;
04206   fMaskAtmosSpecNumuCV    = 0;
04207   fMaskAtmosSpecNumuBarCV = 0; 
04208   fMaskAtmosSpecNueCV     = 0;
04209   fMaskAtmosSpecNueBarCV  = 0; 
04210   fMaskAtmosSpecNuRock    = 0;
04211   fMaskAtmosSpecNuBarRock = 0;
04212   fMaskAtmosZenith        = 0;
04213   fMaskAtmosNumuTrkEn     = 0;
04214   fMaskAtmosNumuTrkEnExit = 0;
04215   fMaskAtmosNumuShwEn     = 0;
04216   fMaskAtmosNueEnergy     = 0;
04217 
04218   if( fDebug ){ std::cout << " -*- oscillations (simplex) -*- " << std::endl; }
04219   fUseSimplex = 1;  RunFitWithMinuit();
04220 
04221   if( fDebug ){ std::cout << " -*- oscillations (migrad) -*- " << std::endl; }
04222   fUseSimplex = 0;  RunFitWithMinuit();
04223 
04224 
04225   // (2) major systematics
04226   fMaskDmsq               = 0;
04227   fMaskSinsq23            = 0;
04228   fMaskSinsq13            = 0;
04229   fMaskDeltaCP            = 0;
04230   fMaskBeamNumuNorm       = 1;
04231   fMaskBeamNumuNCBkg      = 1;
04232   fMaskBeamNumuShwEn      = 1;
04233   fMaskBeamNumuTrkEn      = 1;
04234   fMaskBeamNumuTrkEnExit  = 1;
04235   fMaskBeamNueNorm        = 1;
04236   fMaskBeamNueNCBkg       = 1;
04237   fMaskBeamNueEnergy      = 1;
04238   fMaskAtmosNormCV        = 1;
04239   fMaskAtmosNormRock      = 1;
04240   fMaskAtmosChgCV         = 1;
04241   fMaskAtmosChgRock       = 1;
04242   fMaskAtmosNueNorm       = 0;
04243   fMaskAtmosNueRatio      = 0;
04244   fMaskAtmosNCBkg         = 0;
04245   fMaskAtmosSpecNumuCV    = 1;
04246   fMaskAtmosSpecNumuBarCV = 1;  
04247   fMaskAtmosSpecNueCV     = 1;
04248   fMaskAtmosSpecNueBarCV  = 1;  
04249   fMaskAtmosSpecNuRock    = 1;
04250   fMaskAtmosSpecNuBarRock = 1;
04251   fMaskAtmosZenith        = 0;
04252   fMaskAtmosNumuTrkEn     = 0;
04253   fMaskAtmosNumuTrkEnExit = 0;
04254   fMaskAtmosNumuShwEn     = 0;
04255   fMaskAtmosNueEnergy     = 0;
04256 
04257   if( fDebug ){ std::cout << " -*- major systematics (simplex) -*- " << std::endl; }
04258   fUseSimplex = 1;  RunFitWithMinuit();
04259 
04260   if( fDebug ){ std::cout << " -*- major systematics (migrad) -*- " << std::endl; }
04261   fUseSimplex = 0;  RunFitWithMinuit();  
04262 
04263 
04264   // (3) minor systematics
04265   fMaskDmsq               = 0;
04266   fMaskSinsq23            = 0;
04267   fMaskSinsq13            = 0;
04268   fMaskDeltaCP            = 0;
04269   fMaskBeamNumuNorm       = 0;
04270   fMaskBeamNumuNCBkg      = 0;
04271   fMaskBeamNumuShwEn      = 0;
04272   fMaskBeamNumuTrkEn      = 0;
04273   fMaskBeamNumuTrkEnExit  = 0;
04274   fMaskBeamNueNorm        = 0;
04275   fMaskBeamNueNCBkg       = 0;
04276   fMaskBeamNueEnergy      = 0;
04277   fMaskAtmosNormCV        = 0;
04278   fMaskAtmosNormRock      = 0;
04279   fMaskAtmosChgCV         = 0;
04280   fMaskAtmosChgRock       = 0;
04281   fMaskAtmosNueNorm       = 1;
04282   fMaskAtmosNueRatio      = 1;
04283   fMaskAtmosNCBkg         = 1;
04284   fMaskAtmosSpecNumuCV    = 0;
04285   fMaskAtmosSpecNumuBarCV = 0; 
04286   fMaskAtmosSpecNueCV     = 0;
04287   fMaskAtmosSpecNueBarCV  = 0; 
04288   fMaskAtmosSpecNuRock    = 0;
04289   fMaskAtmosSpecNuBarRock = 0;
04290   fMaskAtmosZenith        = 1;
04291   fMaskAtmosNumuTrkEn     = 1;
04292   fMaskAtmosNumuTrkEnExit = 1;
04293   fMaskAtmosNumuShwEn     = 1;
04294   fMaskAtmosNueEnergy     = 1;
04295 
04296   if( fDebug ){ std::cout << " -*- minor systematics (migrad) -*- " << std::endl; }
04297   fUseSimplex = 0;  RunFitWithMinuit();
04298 
04299 
04300   // (4) all parameters
04301   fMaskDmsq               = 1;
04302   fMaskSinsq23            = 1;
04303   fMaskSinsq13            = 1;
04304   fMaskDeltaCP            = 1;
04305   fMaskBeamNumuNorm       = 1;
04306   fMaskBeamNumuNCBkg      = 1;
04307   fMaskBeamNumuShwEn      = 1;
04308   fMaskBeamNumuTrkEn      = 1;
04309   fMaskBeamNumuTrkEnExit  = 1;
04310   fMaskBeamNueNorm        = 1;
04311   fMaskBeamNueNCBkg       = 1;
04312   fMaskBeamNueEnergy      = 1;
04313   fMaskAtmosNormCV        = 1;
04314   fMaskAtmosNormRock      = 1;
04315   fMaskAtmosChgCV         = 1;
04316   fMaskAtmosChgRock       = 1;
04317   fMaskAtmosNueNorm       = 1;
04318   fMaskAtmosNueRatio      = 1;
04319   fMaskAtmosNCBkg         = 1;
04320   fMaskAtmosSpecNumuCV    = 1;
04321   fMaskAtmosSpecNumuBarCV = 1; 
04322   fMaskAtmosSpecNueCV     = 1;
04323   fMaskAtmosSpecNueBarCV  = 1; 
04324   fMaskAtmosSpecNuRock    = 1;
04325   fMaskAtmosSpecNuBarRock = 1;
04326   fMaskAtmosZenith        = 1;
04327   fMaskAtmosNumuTrkEn     = 1;
04328   fMaskAtmosNumuTrkEnExit = 1;
04329   fMaskAtmosNumuShwEn     = 1;
04330   fMaskAtmosNueEnergy     = 1;
04331 
04332   if( fDebug ){ std::cout << " -*- all parameters (migrad) -*- " << std::endl; }
04333   fUseSimplex = 0;  RunFitWithMinuit();
04334 
04335   return;
04336 }

void ThreeFlavourFitter::RunOscFit ( Bool_t  isNormal = 1,
Int_t  ifirst = -1,
Int_t  ilast = -1,
Int_t  jfirst = -1,
Int_t  jlast = -1 
)

Definition at line 2716 of file ThreeFlavourFitter.cxx.

References BuildExpt(), fBigNumber, fFitDmsq, fFitSinsq23, fLnL68, fLnL90, fLnL99, fOutFile, fSeedAtmosChgCV, fSeedAtmosChgRock, fSeedAtmosNCBkg, fSeedAtmosNormCV, fSeedAtmosNormRock, fSeedAtmosNueEnergy, fSeedAtmosNueNorm, fSeedAtmosNueRatio, fSeedAtmosNumuShwEn, fSeedAtmosNumuTrkEn, fSeedAtmosNumuTrkEnExit, fSeedAtmosSpecNuBarRock, fSeedAtmosSpecNueBarCV, fSeedAtmosSpecNueCV, fSeedAtmosSpecNumuBarCV, fSeedAtmosSpecNumuCV, fSeedAtmosSpecNuRock, fSeedAtmosZenith, fSeedBeamNueEnergy, fSeedBeamNueNCBkg, fSeedBeamNueNorm, fSeedBeamNumuNCBkg, fSeedBeamNumuNorm, fSeedBeamNumuShwEn, fSeedBeamNumuTrkEn, fSeedBeamNumuTrkEnExit, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, fWriteTemplates, GetDmsq(), GetDmsqBins(), GetDmsqMax(), GetDmsqMin(), GetSinsq23(), GetSinsq23Bins(), GetSinsq23Max(), GetSinsq23Min(), Instance(), PrintGrid(), PrintSettings(), RunFit(), RunTemplates(), TouchExpt(), UsingAtmosData(), and UsingBeamData().

02717 {
02718   std::cout << " *** ThreeFlavourFitter::StartOscFit(...) *** " << std::endl;
02719 
02720   // Print Grid
02721   // ==========
02722   this->PrintGrid();
02723 
02724   // Print Settings
02725   // ==============
02726   this->PrintSettings();
02727 
02728   // Build Experiment
02729   // ================
02730   if( this->TouchExpt()==0 ){
02731     this->BuildExpt();
02732   }
02733 
02734   // Write Experiment
02735   // ================
02736   if( fWriteTemplates ){
02737     this->RunTemplates();
02738   }
02739 
02740   std::cout << " *** ThreeFlavourFitter::RunOscFit(...) *** " << std::endl;
02741 
02742   // Build Histograms
02743   // ================  
02744   // x-axis: Sinsq23
02745   // y-axis: Dmsq
02746 
02747   Int_t nx = GetSinsq23Bins();
02748   Double_t xlow = GetSinsq23Min();
02749   Double_t xhigh = GetSinsq23Max();
02750   Double_t dx = (xhigh-xlow)/((double)nx-1.0);
02751   Double_t xmin = xlow  - 0.50*dx;
02752   Double_t xmax = xhigh + 0.50*dx;
02753   
02754   Int_t ny = GetDmsqBins();
02755   Double_t ylow = GetDmsqMin();
02756   Double_t yhigh = GetDmsqMax();
02757   Double_t dy = (yhigh-ylow)/((double)ny-1.0);
02758   Double_t ymin = ylow  - 0.50*dy;
02759   Double_t ymax = yhigh + 0.50*dy;
02760 
02761   TH2D* hHierarchy = new TH2D("hHierarchy", "", nx,xmin,xmax, ny,ymin,ymax);
02762   TH2D* hDmsq      = new TH2D("hDmsq",      "", nx,xmin,xmax, ny,ymin,ymax);
02763   TH2D* hSinsq23   = new TH2D("hSinsq23",   "", nx,xmin,xmax, ny,ymin,ymax);
02764   TH2D* hSinsq13   = new TH2D("hSinsq13",   "", nx,xmin,xmax, ny,ymin,ymax);
02765   TH2D* hDeltaCP   = new TH2D("hDeltaCP",   "", nx,xmin,xmax, ny,ymin,ymax);
02766   TH2D* hDeltaCP0  = new TH2D("hDeltaCP0",  "", nx,xmin,xmax, ny,ymin,ymax);
02767 
02768   TH2D* hBeamNumuNorm  = new TH2D("hBeamNumuNorm", "", nx,xmin,xmax, ny,ymin,ymax); 
02769   hBeamNumuNorm->GetZaxis()->SetTitle("Shift / #sigma");
02770   hBeamNumuNorm->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02771   hBeamNumuNorm->GetXaxis()->SetTitle("sin^{2}#theta");
02772   hBeamNumuNorm->GetZaxis()->CenterTitle();
02773   hBeamNumuNorm->GetYaxis()->CenterTitle();
02774   hBeamNumuNorm->GetXaxis()->CenterTitle();
02775 
02776   TH2D* hBeamNumuNCBkg = new TH2D("hBeamNumuNCBkg","", nx,xmin,xmax, ny,ymin,ymax);
02777   hBeamNumuNCBkg->GetZaxis()->SetTitle("Shift / #sigma");
02778   hBeamNumuNCBkg->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02779   hBeamNumuNCBkg->GetXaxis()->SetTitle("sin^{2}#theta");
02780   hBeamNumuNCBkg->GetZaxis()->CenterTitle();
02781   hBeamNumuNCBkg->GetYaxis()->CenterTitle();
02782   hBeamNumuNCBkg->GetXaxis()->CenterTitle();
02783 
02784   TH2D* hBeamNumuShwEn = new TH2D("hBeamNumuShwEn","", nx,xmin,xmax, ny,ymin,ymax);  
02785   hBeamNumuShwEn->GetZaxis()->SetTitle("Shift / #sigma");
02786   hBeamNumuShwEn->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02787   hBeamNumuShwEn->GetXaxis()->SetTitle("sin^{2}#theta");
02788   hBeamNumuShwEn->GetZaxis()->CenterTitle();
02789   hBeamNumuShwEn->GetYaxis()->CenterTitle();
02790   hBeamNumuShwEn->GetXaxis()->CenterTitle();
02791 
02792   TH2D* hBeamNumuTrkEn = new TH2D("hBeamNumuTrkEn","", nx,xmin,xmax, ny,ymin,ymax);
02793   hBeamNumuTrkEn->GetZaxis()->SetTitle("Shift / #sigma");
02794   hBeamNumuTrkEn->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02795   hBeamNumuTrkEn->GetXaxis()->SetTitle("sin^{2}#theta");
02796   hBeamNumuTrkEn->GetZaxis()->CenterTitle();
02797   hBeamNumuTrkEn->GetYaxis()->CenterTitle();
02798   hBeamNumuTrkEn->GetXaxis()->CenterTitle();
02799 
02800   TH2D* hBeamNumuTrkEnExit = new TH2D("hBeamNumuTrkEnExit","", nx,xmin,xmax, ny,ymin,ymax);
02801   hBeamNumuTrkEnExit->GetZaxis()->SetTitle("Shift / #sigma");
02802   hBeamNumuTrkEnExit->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02803   hBeamNumuTrkEnExit->GetXaxis()->SetTitle("sin^{2}#theta");
02804   hBeamNumuTrkEnExit->GetZaxis()->CenterTitle();
02805   hBeamNumuTrkEnExit->GetYaxis()->CenterTitle();
02806   hBeamNumuTrkEnExit->GetXaxis()->CenterTitle();
02807 
02808   TH2D* hBeamNueNorm  = new TH2D("hBeamNueNorm", "", nx,xmin,xmax, ny,ymin,ymax); 
02809   hBeamNueNorm->GetZaxis()->SetTitle("Shift / #sigma");
02810   hBeamNueNorm->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02811   hBeamNueNorm->GetXaxis()->SetTitle("sin^{2}#theta");
02812   hBeamNueNorm->GetZaxis()->CenterTitle();
02813   hBeamNueNorm->GetYaxis()->CenterTitle();
02814   hBeamNueNorm->GetXaxis()->CenterTitle();
02815 
02816   TH2D* hBeamNueNCBkg = new TH2D("hBeamNueNCBkg","", nx,xmin,xmax, ny,ymin,ymax);
02817   hBeamNueNCBkg->GetZaxis()->SetTitle("Shift / #sigma");
02818   hBeamNueNCBkg->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02819   hBeamNueNCBkg->GetXaxis()->SetTitle("sin^{2}#theta");
02820   hBeamNueNCBkg->GetZaxis()->CenterTitle();
02821   hBeamNueNCBkg->GetYaxis()->CenterTitle();
02822   hBeamNueNCBkg->GetXaxis()->CenterTitle();
02823 
02824   TH2D* hBeamNueEnergy = new TH2D("hBeamNueEnergy","", nx,xmin,xmax, ny,ymin,ymax);  
02825   hBeamNueEnergy->GetZaxis()->SetTitle("Shift / #sigma");
02826   hBeamNueEnergy->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02827   hBeamNueEnergy->GetXaxis()->SetTitle("sin^{2}#theta");
02828   hBeamNueEnergy->GetZaxis()->CenterTitle();
02829   hBeamNueEnergy->GetYaxis()->CenterTitle();
02830   hBeamNueEnergy->GetXaxis()->CenterTitle();
02831 
02832   TH2D* hAtmosNormCV = new TH2D("hAtmosNormCV","", nx,xmin,xmax, ny,ymin,ymax);
02833   hAtmosNormCV->GetZaxis()->SetTitle("Shift / #sigma");
02834   hAtmosNormCV->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02835   hAtmosNormCV->GetXaxis()->SetTitle("sin^{2}#theta");
02836   hAtmosNormCV->GetZaxis()->CenterTitle();
02837   hAtmosNormCV->GetYaxis()->CenterTitle();
02838   hAtmosNormCV->GetXaxis()->CenterTitle();
02839 
02840   TH2D* hAtmosNormRock = new TH2D("hAtmosNormRock","", nx,xmin,xmax, ny,ymin,ymax);
02841   hAtmosNormRock->GetZaxis()->SetTitle("Shift / #sigma");
02842   hAtmosNormRock->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02843   hAtmosNormRock->GetXaxis()->SetTitle("sin^{2}#theta");
02844   hAtmosNormRock->GetZaxis()->CenterTitle();
02845   hAtmosNormRock->GetYaxis()->CenterTitle();
02846   hAtmosNormRock->GetXaxis()->CenterTitle();
02847 
02848   TH2D* hAtmosChgCV = new TH2D("hAtmosChgCV","", nx,xmin,xmax, ny,ymin,ymax);
02849   hAtmosChgCV->GetZaxis()->SetTitle("Shift / #sigma");
02850   hAtmosChgCV->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02851   hAtmosChgCV->GetXaxis()->SetTitle("sin^{2}#theta");
02852   hAtmosChgCV->GetZaxis()->CenterTitle();
02853   hAtmosChgCV->GetYaxis()->CenterTitle();
02854   hAtmosChgCV->GetXaxis()->CenterTitle();
02855 
02856   TH2D* hAtmosChgRock = new TH2D("hAtmosChgRock","", nx,xmin,xmax, ny,ymin,ymax);
02857   hAtmosChgRock->GetZaxis()->SetTitle("Shift / #sigma");
02858   hAtmosChgRock->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02859   hAtmosChgRock->GetXaxis()->SetTitle("sin^{2}#theta");
02860   hAtmosChgRock->GetZaxis()->CenterTitle();
02861   hAtmosChgRock->GetYaxis()->CenterTitle();
02862   hAtmosChgRock->GetXaxis()->CenterTitle();
02863 
02864   TH2D* hAtmosNueNorm = new TH2D("hAtmosNueNorm","", nx,xmin,xmax, ny,ymin,ymax);
02865   hAtmosNueNorm->GetZaxis()->SetTitle("Shift / #sigma");
02866   hAtmosNueNorm->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02867   hAtmosNueNorm->GetXaxis()->SetTitle("sin^{2}#theta");
02868   hAtmosNueNorm->GetZaxis()->CenterTitle();
02869   hAtmosNueNorm->GetYaxis()->CenterTitle();
02870   hAtmosNueNorm->GetXaxis()->CenterTitle();
02871 
02872   TH2D* hAtmosNueRatio = new TH2D("hAtmosNueRatio","", nx,xmin,xmax, ny,ymin,ymax);
02873   hAtmosNueRatio->GetZaxis()->SetTitle("Shift / #sigma");
02874   hAtmosNueRatio->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02875   hAtmosNueRatio->GetXaxis()->SetTitle("sin^{2}#theta");
02876   hAtmosNueRatio->GetZaxis()->CenterTitle();
02877   hAtmosNueRatio->GetYaxis()->CenterTitle();
02878   hAtmosNueRatio->GetXaxis()->CenterTitle();
02879 
02880   TH2D* hAtmosNCBkg = new TH2D("hAtmosNCBkg","", nx,xmin,xmax, ny,ymin,ymax);
02881   hAtmosNCBkg->GetZaxis()->SetTitle("Shift / #sigma");
02882   hAtmosNCBkg->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02883   hAtmosNCBkg->GetXaxis()->SetTitle("sin^{2}#theta");
02884   hAtmosNCBkg->GetZaxis()->CenterTitle();
02885   hAtmosNCBkg->GetYaxis()->CenterTitle();
02886   hAtmosNCBkg->GetXaxis()->CenterTitle();
02887 
02888   TH2D* hAtmosSpecNumuCV = new TH2D("hAtmosSpecNumuCV","", nx,xmin,xmax, ny,ymin,ymax);
02889   hAtmosSpecNumuCV->GetZaxis()->SetTitle("Shift / #sigma");
02890   hAtmosSpecNumuCV->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02891   hAtmosSpecNumuCV->GetXaxis()->SetTitle("sin^{2}#theta");
02892   hAtmosSpecNumuCV->GetZaxis()->CenterTitle();
02893   hAtmosSpecNumuCV->GetYaxis()->CenterTitle();
02894   hAtmosSpecNumuCV->GetXaxis()->CenterTitle();
02895 
02896   TH2D* hAtmosSpecNumuBarCV = new TH2D("hAtmosSpecNumuBarCV","", nx,xmin,xmax, ny,ymin,ymax);
02897   hAtmosSpecNumuBarCV->GetZaxis()->SetTitle("Shift / #sigma");
02898   hAtmosSpecNumuBarCV->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02899   hAtmosSpecNumuBarCV->GetXaxis()->SetTitle("sin^{2}#theta");
02900   hAtmosSpecNumuBarCV->GetZaxis()->CenterTitle();
02901   hAtmosSpecNumuBarCV->GetYaxis()->CenterTitle();
02902   hAtmosSpecNumuBarCV->GetXaxis()->CenterTitle();  
02903 
02904   TH2D* hAtmosSpecNueCV = new TH2D("hAtmosSpecNueCV","", nx,xmin,xmax, ny,ymin,ymax);
02905   hAtmosSpecNueCV->GetZaxis()->SetTitle("Shift / #sigma");
02906   hAtmosSpecNueCV->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02907   hAtmosSpecNueCV->GetXaxis()->SetTitle("sin^{2}#theta");
02908   hAtmosSpecNueCV->GetZaxis()->CenterTitle();
02909   hAtmosSpecNueCV->GetYaxis()->CenterTitle();
02910   hAtmosSpecNueCV->GetXaxis()->CenterTitle();
02911 
02912   TH2D* hAtmosSpecNueBarCV = new TH2D("hAtmosSpecNueBarCV","", nx,xmin,xmax, ny,ymin,ymax);
02913   hAtmosSpecNueBarCV->GetZaxis()->SetTitle("Shift / #sigma");
02914   hAtmosSpecNueBarCV->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02915   hAtmosSpecNueBarCV->GetXaxis()->SetTitle("sin^{2}#theta");
02916   hAtmosSpecNueBarCV->GetZaxis()->CenterTitle();
02917   hAtmosSpecNueBarCV->GetYaxis()->CenterTitle();
02918   hAtmosSpecNueBarCV->GetXaxis()->CenterTitle(); 
02919 
02920   TH2D* hAtmosSpecNuRock = new TH2D("hAtmosSpecNuRock","", nx,xmin,xmax, ny,ymin,ymax);
02921   hAtmosSpecNuRock->GetZaxis()->SetTitle("Shift / #sigma");
02922   hAtmosSpecNuRock->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02923   hAtmosSpecNuRock->GetXaxis()->SetTitle("sin^{2}#theta");
02924   hAtmosSpecNuRock->GetZaxis()->CenterTitle();
02925   hAtmosSpecNuRock->GetYaxis()->CenterTitle();
02926   hAtmosSpecNuRock->GetXaxis()->CenterTitle();
02927 
02928   TH2D* hAtmosSpecNuBarRock = new TH2D("hAtmosSpecNuBarRock","", nx,xmin,xmax, ny,ymin,ymax);
02929   hAtmosSpecNuBarRock->GetZaxis()->SetTitle("Shift / #sigma");
02930   hAtmosSpecNuBarRock->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02931   hAtmosSpecNuBarRock->GetXaxis()->SetTitle("sin^{2}#theta");
02932   hAtmosSpecNuBarRock->GetZaxis()->CenterTitle();
02933   hAtmosSpecNuBarRock->GetYaxis()->CenterTitle();
02934   hAtmosSpecNuBarRock->GetXaxis()->CenterTitle();
02935 
02936   TH2D* hAtmosZenith = new TH2D("hAtmosZenith","", nx,xmin,xmax, ny,ymin,ymax);
02937   hAtmosZenith->GetZaxis()->SetTitle("Shift / #sigma");
02938   hAtmosZenith->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02939   hAtmosZenith->GetXaxis()->SetTitle("sin^{2}#theta");
02940   hAtmosZenith->GetZaxis()->CenterTitle();
02941   hAtmosZenith->GetYaxis()->CenterTitle();
02942   hAtmosZenith->GetXaxis()->CenterTitle();
02943 
02944   TH2D* hAtmosNumuTrkEn = new TH2D("hAtmosNumuTrkEn","", nx,xmin,xmax, ny,ymin,ymax);
02945   hAtmosNumuTrkEn->GetZaxis()->SetTitle("Shift / #sigma");
02946   hAtmosNumuTrkEn->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02947   hAtmosNumuTrkEn->GetXaxis()->SetTitle("sin^{2}#theta");
02948   hAtmosNumuTrkEn->GetZaxis()->CenterTitle();
02949   hAtmosNumuTrkEn->GetYaxis()->CenterTitle();
02950   hAtmosNumuTrkEn->GetXaxis()->CenterTitle();
02951 
02952   TH2D* hAtmosNumuTrkEnExit = new TH2D("hAtmosNumuTrkEnExit","", nx,xmin,xmax, ny,ymin,ymax);
02953   hAtmosNumuTrkEnExit->GetZaxis()->SetTitle("Shift / #sigma");
02954   hAtmosNumuTrkEnExit->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02955   hAtmosNumuTrkEnExit->GetXaxis()->SetTitle("sin^{2}#theta");
02956   hAtmosNumuTrkEnExit->GetZaxis()->CenterTitle();
02957   hAtmosNumuTrkEnExit->GetYaxis()->CenterTitle();
02958   hAtmosNumuTrkEnExit->GetXaxis()->CenterTitle();
02959 
02960   TH2D* hAtmosNumuShwEn = new TH2D("hAtmosNumuShwEn","", nx,xmin,xmax, ny,ymin,ymax);
02961   hAtmosNumuShwEn->GetZaxis()->SetTitle("Shift / #sigma");
02962   hAtmosNumuShwEn->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02963   hAtmosNumuShwEn->GetXaxis()->SetTitle("sin^{2}#theta");
02964   hAtmosNumuShwEn->GetZaxis()->CenterTitle();
02965   hAtmosNumuShwEn->GetYaxis()->CenterTitle();
02966   hAtmosNumuShwEn->GetXaxis()->CenterTitle();
02967 
02968   TH2D* hAtmosNueEnergy = new TH2D("hAtmosNueEnergy","", nx,xmin,xmax, ny,ymin,ymax);
02969   hAtmosNueEnergy->GetZaxis()->SetTitle("Shift / #sigma");
02970   hAtmosNueEnergy->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02971   hAtmosNueEnergy->GetXaxis()->SetTitle("sin^{2}#theta");
02972   hAtmosNueEnergy->GetZaxis()->CenterTitle();
02973   hAtmosNueEnergy->GetYaxis()->CenterTitle();
02974   hAtmosNueEnergy->GetXaxis()->CenterTitle();
02975 
02976   TH2D* hLnLTotal = new TH2D("hLnLTotal", "", nx,xmin,xmax, ny,ymin,ymax);
02977   hLnLTotal->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02978   hLnLTotal->GetXaxis()->SetTitle("sin^{2}#theta");
02979   hLnLTotal->GetYaxis()->CenterTitle();
02980   hLnLTotal->GetXaxis()->CenterTitle();
02981 
02982   TH2D* hLnL = new TH2D("hLnL", "", nx,xmin,xmax, ny,ymin,ymax);
02983   hLnL->GetYaxis()->SetTitle("#Delta m^{2} / eV^{2}");
02984   hLnL->GetXaxis()->SetTitle("sin^{2}#theta");
02985   hLnL->GetYaxis()->CenterTitle();
02986   hLnL->GetXaxis()->CenterTitle();
02987 
02988   //
02989   // Print Binning
02990   // -------------
02991   // std::cout << " --- dmsq --- " << std::endl;
02992   // for( Int_t n=0; n<hLnL->GetYaxis()->GetNbins(); n++ ){
02993   //   std::cout << " [" << n << "] " << hLnL->GetYaxis()->GetBinCenter(n+1) << std::endl;
02994   // }
02995   //
02996   // std::cout << " --- sinsq23 --- " << std::endl;
02997   // for( Int_t n=0; n<hLnL->GetXaxis()->GetNbins(); n++ ){
02998   //   std::cout << " [" << n << "] " << hLnL->GetXaxis()->GetBinCenter(n+1) << std::endl;
02999   // }
03000   //
03001 
03002  
03003   // Run Oscillation Fit
03004   // ==================
03005   Double_t input_dmsq    = 0.0;
03006   Double_t input_sinsq23 = 0.0;
03007   Double_t input_sinsq13 = 0.0;
03008   Double_t input_deltaCP = 0.0;
03009   
03010   Double_t osc_hierarchy         = 0.0;
03011   Double_t osc_dmsq              = 0.0;
03012   Double_t osc_sinsq23           = 0.0;
03013   Double_t osc_sinsq13           = 0.0;
03014   Double_t osc_deltaCP           = 0.0;
03015   Double_t beam_numu_norm        = 0.0;
03016   Double_t beam_numu_ncbkg       = 0.0;
03017   Double_t beam_numu_shwen       = 0.0;
03018   Double_t beam_numu_trken       = 0.0;
03019   Double_t beam_numu_trken_exit  = 0.0;
03020   Double_t beam_nue_norm         = 0.0;
03021   Double_t beam_nue_ncbkg        = 0.0;
03022   Double_t beam_nue_energy       = 0.0;
03023   Double_t atmos_norm_cv         = 0.0;
03024   Double_t atmos_norm_rock       = 0.0;
03025   Double_t atmos_chg_cv          = 0.0;
03026   Double_t atmos_chg_rock        = 0.0;
03027   Double_t atmos_nue_norm        = 0.0;
03028   Double_t atmos_nue_ratio       = 0.0;
03029   Double_t atmos_ncbkg           = 0.0;
03030   Double_t atmos_spec_cv_numu    = 0.0;
03031   Double_t atmos_spec_cv_numubar = 0.0;
03032   Double_t atmos_spec_cv_nue     = 0.0;
03033   Double_t atmos_spec_cv_nuebar  = 0.0;
03034   Double_t atmos_spec_rock_nu    = 0.0;
03035   Double_t atmos_spec_rock_nubar = 0.0;
03036   Double_t atmos_zenith          = 0.0;
03037   Double_t atmos_numu_trken      = 0.0;
03038   Double_t atmos_numu_trken_exit = 0.0;
03039   Double_t atmos_numu_shwen      = 0.0;
03040   Double_t atmos_nue_energy      = 0.0;
03041 
03042   Double_t output_dmsq = 0.0;
03043 
03044   Double_t LnL = 0.0; 
03045   Double_t minLnL = fBigNumber;
03046 
03047   Int_t ibest = -1;
03048   Int_t jbest = -1;
03049 
03050   if( ifirst<0 ) ifirst = 0;
03051   if( ilast<0 )  ilast  = GetDmsqBins();
03052   if( ilast>GetDmsqBins() ) ilast = GetDmsqBins();
03053 
03054   if( jfirst<0 ) jfirst = 0;
03055   if( jlast<0 )  jlast  = GetSinsq23Bins();
03056   if( jlast>GetSinsq23Bins() ) jlast = GetSinsq23Bins();
03057 
03058   // Loop over Dmsq Bins (y-axis)
03059   for( Int_t i=ifirst; i<ilast; i++ ){          
03060     std::cout << " ---- RunFit: [" << i << "] [" << ifirst << "|" << ilast << "] --- " << std::endl;
03061 
03062     // Loop over Sinsq Bins (x-axis)
03063     for( Int_t j=jfirst; j<jlast; j++ ){  
03064       std::cout << "              [" << i << "] [" << j << "]" << std::endl;
03065 
03066       // Input Parameters
03067       input_dmsq = GetDmsq( i );
03068       input_sinsq23 = GetSinsq23( j );
03069       input_sinsq13 = fSeedSinsq13;
03070       input_deltaCP = fSeedDeltaCP;    
03071 
03072       if( fFitDmsq  )   input_dmsq = fabs(fSeedDmsq);
03073       if( fFitSinsq23 ) input_sinsq23 = fSeedSinsq23;
03074 
03075       if( isNormal==0 ) input_dmsq = -input_dmsq;
03076 
03077       // Run Fit
03078       this->RunFit( input_dmsq,         input_sinsq23,
03079                     input_sinsq13,      input_deltaCP,
03080                     osc_dmsq,           osc_sinsq23,
03081                     osc_sinsq13,        osc_deltaCP,    
03082                     beam_numu_norm,     beam_numu_ncbkg,
03083                     beam_numu_shwen,    beam_numu_trken,
03084                     beam_numu_trken_exit,
03085                     beam_nue_norm,      beam_nue_ncbkg,
03086                     beam_nue_energy, 
03087                     atmos_norm_cv,      atmos_norm_rock, 
03088                     atmos_chg_cv,       atmos_chg_rock, 
03089                     atmos_nue_norm,     atmos_nue_ratio,            
03090                     atmos_ncbkg,
03091                     atmos_spec_cv_numu, atmos_spec_cv_numubar, 
03092                     atmos_spec_cv_nue,  atmos_spec_cv_nuebar, 
03093                     atmos_spec_rock_nu, atmos_spec_rock_nubar,
03094                     atmos_zenith,
03095                     atmos_numu_trken,   atmos_numu_trken_exit,
03096                     atmos_numu_shwen,   atmos_nue_energy,
03097                     LnL );
03098 
03099       if( osc_dmsq>=0.0 ) osc_hierarchy = +1.0;
03100       else                osc_hierarchy = -1.0;
03101 
03102       hHierarchy->SetBinContent( j+1, i+1, osc_hierarchy );
03103       hDmsq->SetBinContent( j+1, i+1, fabs(osc_dmsq) );
03104       hSinsq23->SetBinContent( j+1, i+1, osc_sinsq23 );
03105       hSinsq13->SetBinContent( j+1, i+1, osc_sinsq13 );
03106       hDeltaCP->SetBinContent( j+1, i+1, osc_deltaCP );
03107       hDeltaCP0->SetBinContent( j+1, i+1, osc_deltaCP );
03108 
03109       hBeamNumuNorm->SetBinContent( j+1, i+1, beam_numu_norm );
03110       hBeamNumuNCBkg->SetBinContent( j+1, i+1, beam_numu_ncbkg );
03111       hBeamNumuShwEn->SetBinContent( j+1, i+1, beam_numu_shwen );
03112       hBeamNumuTrkEn->SetBinContent( j+1, i+1, beam_numu_trken );
03113       hBeamNumuTrkEnExit->SetBinContent( j+1, i+1, beam_numu_trken_exit );
03114       hBeamNueNorm->SetBinContent( j+1, i+1, beam_nue_norm );
03115       hBeamNueNCBkg->SetBinContent( j+1, i+1, beam_nue_ncbkg );
03116       hBeamNueEnergy->SetBinContent( j+1, i+1, beam_nue_energy );
03117 
03118       hAtmosNormCV->SetBinContent( j+1, i+1, atmos_norm_cv );
03119       hAtmosNormRock->SetBinContent( j+1, i+1, atmos_norm_rock );
03120       hAtmosChgCV->SetBinContent( j+1, i+1,atmos_chg_cv );
03121       hAtmosChgRock->SetBinContent( j+1, i+1,atmos_chg_rock );
03122       hAtmosNueNorm->SetBinContent( j+1, i+1, atmos_nue_norm );
03123       hAtmosNueRatio->SetBinContent( j+1, i+1, atmos_nue_ratio );
03124       hAtmosNCBkg->SetBinContent( j+1, i+1, atmos_ncbkg );
03125       hAtmosSpecNumuCV->SetBinContent( j+1, i+1,atmos_spec_cv_numu );
03126       hAtmosSpecNumuBarCV->SetBinContent( j+1, i+1, atmos_spec_cv_numubar );
03127       hAtmosSpecNueCV->SetBinContent( j+1, i+1,atmos_spec_cv_nue );
03128       hAtmosSpecNueBarCV->SetBinContent( j+1, i+1, atmos_spec_cv_nuebar );
03129       hAtmosSpecNuRock->SetBinContent( j+1, i+1,atmos_spec_rock_nu );
03130       hAtmosSpecNuBarRock->SetBinContent( j+1, i+1, atmos_spec_rock_nubar );
03131       hAtmosZenith->SetBinContent( j+1, i+1, atmos_zenith );
03132       hAtmosNumuTrkEn->SetBinContent( j+1, i+1, atmos_numu_trken );
03133       hAtmosNumuTrkEnExit->SetBinContent( j+1, i+1, atmos_numu_trken_exit );
03134       hAtmosNumuShwEn->SetBinContent( j+1, i+1,atmos_numu_shwen );
03135       hAtmosNueEnergy->SetBinContent( j+1, i+1,atmos_nue_energy );
03136 
03137       hLnL->SetBinContent( j+1, i+1, LnL );
03138       hLnLTotal->SetBinContent( j+1, i+1, LnL );
03139 
03140       // Best Fit
03141       if( LnL<minLnL ){
03142         ibest = i; 
03143         jbest = j;
03144         minLnL = LnL;
03145       }
03146 
03147     }
03148   }
03149 
03150   
03151   // Best Fit Oscillations
03152   // =====================
03153   if( ibest>=0 && jbest>=0 ){
03154  
03155     for( Int_t i=0; i<hLnL->GetYaxis()->GetNbins(); i++ ){
03156       for( Int_t j=0; j<hLnL->GetXaxis()->GetNbins(); j++ ){    
03157         Double_t myLnL = hLnL->GetBinContent( j+1, i+1 );
03158         hLnL->SetBinContent( j+1, i+1, myLnL - minLnL );
03159       }
03160     }
03161 
03162     osc_hierarchy = hHierarchy->GetBinContent( jbest+1, ibest+1 );
03163     osc_dmsq      = hDmsq->GetBinContent( jbest+1, ibest+1 );
03164     osc_sinsq23   = hSinsq23->GetBinContent( jbest+1, ibest+1 );
03165     osc_sinsq13   = hSinsq13->GetBinContent( jbest+1, ibest+1 );
03166     osc_deltaCP   = hDeltaCP->GetBinContent( jbest+1, ibest+1 );
03167 
03168     output_dmsq   = osc_hierarchy*osc_dmsq;
03169 
03170     beam_numu_norm        = hBeamNumuNorm->GetBinContent( jbest+1, ibest+1 );
03171     beam_numu_ncbkg       = hBeamNumuNCBkg->GetBinContent( jbest+1, ibest+1 );
03172     beam_numu_shwen       = hBeamNumuShwEn->GetBinContent( jbest+1, ibest+1 );
03173     beam_numu_trken       = hBeamNumuTrkEn->GetBinContent( jbest+1, ibest+1 );
03174     beam_numu_trken_exit  = hBeamNumuTrkEnExit->GetBinContent( jbest+1, ibest+1 );
03175     beam_nue_norm         = hBeamNueNorm->GetBinContent( jbest+1, ibest+1 );
03176     beam_nue_ncbkg        = hBeamNueNCBkg->GetBinContent( jbest+1, ibest+1 );
03177     beam_nue_energy       = hBeamNueEnergy->GetBinContent( jbest+1, ibest+1 );
03178 
03179     atmos_norm_cv         = hAtmosNormCV->GetBinContent( jbest+1, ibest+1 );
03180     atmos_norm_rock       = hAtmosNormRock->GetBinContent( jbest+1, ibest+1 );
03181     atmos_chg_cv          = hAtmosChgCV->GetBinContent( jbest+1, ibest+1 );
03182     atmos_chg_rock        = hAtmosChgRock->GetBinContent( jbest+1, ibest+1 );
03183     atmos_nue_norm        = hAtmosNueNorm->GetBinContent( jbest+1, ibest+1 );
03184     atmos_nue_ratio       = hAtmosNueRatio->GetBinContent( jbest+1, ibest+1 );
03185     atmos_ncbkg           = hAtmosNCBkg->GetBinContent( jbest+1, ibest+1 );
03186     atmos_spec_cv_numu    = hAtmosSpecNumuCV->GetBinContent( jbest+1, ibest+1 );
03187     atmos_spec_cv_numubar = hAtmosSpecNumuBarCV->GetBinContent( jbest+1, ibest+1 );
03188     atmos_spec_cv_nue     = hAtmosSpecNueCV->GetBinContent( jbest+1, ibest+1 );
03189     atmos_spec_cv_nuebar  = hAtmosSpecNueBarCV->GetBinContent( jbest+1, ibest+1 );
03190     atmos_spec_rock_nu    = hAtmosSpecNuRock->GetBinContent( jbest+1, ibest+1 );
03191     atmos_spec_rock_nubar = hAtmosSpecNuBarRock->GetBinContent( jbest+1, ibest+1 );
03192     atmos_zenith          = hAtmosZenith->GetBinContent( jbest+1, ibest+1 );
03193     atmos_numu_trken      = hAtmosNumuTrkEn->GetBinContent( jbest+1, ibest+1 );
03194     atmos_numu_trken_exit = hAtmosNumuTrkEnExit->GetBinContent( jbest+1, ibest+1 );
03195     atmos_numu_shwen      = hAtmosNumuShwEn->GetBinContent( jbest+1, ibest+1 );
03196     atmos_nue_energy      = hAtmosNueEnergy->GetBinContent( jbest+1, ibest+1 );
03197 
03198     std::cout << " *** ThreeFlavourFitter::PrintResults() *** " << std::endl;
03199     std::cout << "   OSC FIT RESULTS: " << std::endl;
03200 
03201     std::cout << "    seed parameters: " << std::endl;
03202     if( isNormal ) std::cout << "     osc_dmsq    = " << +fabs(fSeedDmsq) << std::endl;
03203     else           std::cout << "     osc_dmsq    = " << -fabs(fSeedDmsq) << std::endl;
03204     std::cout << "     osc_sinsq23 = " << fSeedSinsq23 << std::endl;
03205     std::cout << "     osc_sinsq13 = " << fSeedSinsq13 << std::endl;
03206     std::cout << "     osc_deltaCP = " << fSeedDeltaCP << std::endl;
03207     if( UsingBeamData() ){
03208       std::cout << "     beam_numu_norm        = " << fSeedBeamNumuNorm  << std::endl;
03209       std::cout << "     beam_numu_ncbkg       = " << fSeedBeamNumuNCBkg << std::endl;
03210       std::cout << "     beam_numu_shwen       = " << fSeedBeamNumuShwEn << std::endl;
03211       std::cout << "     beam_numu_trken       = " << fSeedBeamNumuTrkEn << std::endl;
03212       std::cout << "     beam_numu_trken_exit  = " << fSeedBeamNumuTrkEnExit << std::endl;
03213       std::cout << "     beam_nue_norm         = " << fSeedBeamNueNorm  << std::endl;
03214       std::cout << "     beam_nue_ncbkg        = " << fSeedBeamNueNCBkg << std::endl;
03215       std::cout << "     beam_nue_energy       = " << fSeedBeamNueEnergy << std::endl;
03216     }
03217     if( UsingAtmosData() ){
03218       std::cout << "     atmos_norm_cv         = " << fSeedAtmosNormCV << std::endl;
03219       std::cout << "     atmos_norm_rock       = " << fSeedAtmosNormRock << std::endl; 
03220       std::cout << "     atmos_chg_cv          = " << fSeedAtmosChgCV << std::endl;
03221       std::cout << "     atmos_chg_rock        = " << fSeedAtmosChgRock << std::endl; 
03222       std::cout << "     atmos_nue_norm        = " << fSeedAtmosNueNorm << std::endl; 
03223       std::cout << "     atmos_nue_ratio       = " << fSeedAtmosNueRatio << std::endl;     
03224       std::cout << "     atmos_ncbkg           = " << fSeedAtmosNCBkg << std::endl;
03225       std::cout << "     atmos_spec_cv_numu    = " << fSeedAtmosSpecNumuCV << std::endl;  
03226       std::cout << "     atmos_spec_cv_numubar = " << fSeedAtmosSpecNumuBarCV << std::endl; 
03227       std::cout << "     atmos_spec_cv_nue     = " << fSeedAtmosSpecNueCV << std::endl;  
03228       std::cout << "     atmos_spec_cv_nuebar  = " << fSeedAtmosSpecNueBarCV << std::endl; 
03229       std::cout << "     atmos_spec_rock_nu    = " << fSeedAtmosSpecNuRock << std::endl;  
03230       std::cout << "     atmos_spec_rock_nubar = " << fSeedAtmosSpecNuBarRock << std::endl; 
03231       std::cout << "     atmos_zenith          = " << fSeedAtmosZenith << std::endl;
03232       std::cout << "     atmos_numu_trken      = " << fSeedAtmosNumuTrkEn << std::endl;   
03233       std::cout << "     atmos_numu_trken_exit = " << fSeedAtmosNumuTrkEnExit << std::endl; 
03234       std::cout << "     atmos_numu_shwen      = " << fSeedAtmosNumuShwEn << std::endl;
03235       std::cout << "     atmos_nue_energy      = " << fSeedAtmosNueEnergy << std::endl;
03236     }
03237 
03238     std::cout << "    best fit parameters: " << std::endl; 
03239     std::cout << "     osc_dmsq    = " << output_dmsq << std::endl;
03240     std::cout << "     osc_sinsq23 = " << osc_sinsq23 << std::endl;
03241     std::cout << "     osc_sinsq13 = " << osc_sinsq13 << std::endl;
03242     std::cout << "     osc_deltaCP = " << osc_deltaCP << std::endl;
03243     if( UsingBeamData() ){
03244       std::cout << "     beam_numu_norm        = " << beam_numu_norm << std::endl;
03245       std::cout << "     beam_numu_ncbkg       = " << beam_numu_ncbkg << std::endl;
03246       std::cout << "     beam_numu_shwen       = " << beam_numu_shwen << std::endl;
03247       std::cout << "     beam_numu_trken       = " << beam_numu_trken << std::endl; 
03248       std::cout << "     beam_numu_trken_exit  = " << beam_numu_trken_exit << std::endl; 
03249       std::cout << "     beam_nue_norm         = " << beam_nue_norm << std::endl;
03250       std::cout << "     beam_nue_ncbkg        = " << beam_nue_ncbkg << std::endl;
03251       std::cout << "     beam_nue_energy       = " << beam_nue_energy << std::endl;
03252     }
03253     if( UsingAtmosData() ){
03254       std::cout << "     atmos_norm_cv         = " << atmos_norm_cv << std::endl;
03255       std::cout << "     atmos_norm_rock       = " << atmos_norm_rock << std::endl; 
03256       std::cout << "     atmos_chg_cv          = " << atmos_chg_cv << std::endl;
03257       std::cout << "     atmos_chg_rock        = " << atmos_chg_rock << std::endl;
03258       std::cout << "     atmos_nue_norm        = " << atmos_nue_norm << std::endl;
03259       std::cout << "     atmos_nue_ratio       = " << atmos_nue_ratio << std::endl;
03260       std::cout << "     atmos_ncbkg           = " << atmos_ncbkg << std::endl;
03261       std::cout << "     atmos_spec_cv_numu    = " << atmos_spec_cv_numu << std::endl;
03262       std::cout << "     atmos_spec_cv_numubar = " << atmos_spec_cv_numubar << std::endl;
03263       std::cout << "     atmos_spec_cv_nue     = " << atmos_spec_cv_nue << std::endl;
03264       std::cout << "     atmos_spec_cv_nuebar  = " << atmos_spec_cv_nuebar << std::endl;
03265       std::cout << "     atmos_spec_rock_nu    = " << atmos_spec_rock_nu << std::endl;
03266       std::cout << "     atmos_spec_rock_nubar = " << atmos_spec_rock_nubar << std::endl;
03267       std::cout << "     atmos_zenith          = " << atmos_zenith << std::endl;
03268       std::cout << "     atmos_numu_trken      = " << atmos_numu_trken << std::endl;
03269       std::cout << "     atmos_numu_trken_exit = " << atmos_numu_trken_exit << std::endl;
03270       std::cout << "     atmos_numu_shwen      = " << atmos_numu_shwen << std::endl;      
03271       std::cout << "     atmos_nue_energy      = " << atmos_nue_energy << std::endl;
03272     }
03273 
03274     std::cout << "    goodness of fit: " << std::endl;
03275     std::cout << "     LnLbest=" << minLnL << std::endl;   
03276 
03277     // Write Best Fit Point
03278     if( fWriteTemplates ){
03279 
03280       TString filename = fOutFile;
03281       TString tag = ".bestfit";
03282   
03283       if( filename.EndsWith(".root") )  
03284         filename.Insert(filename.Length()-5,tag);
03285       else filename.Append(tag);
03286     
03287       TemplateWriter::Instance()->WriteExpectation( output_dmsq,        osc_sinsq23,
03288                                                     osc_sinsq13,        osc_deltaCP,
03289                                                     beam_numu_norm,     beam_numu_ncbkg,
03290                                                     beam_numu_shwen,    beam_numu_trken,
03291                                                     beam_numu_trken_exit,
03292                                                     beam_nue_norm,      beam_nue_ncbkg,
03293                                                     beam_nue_energy, 
03294                                                     atmos_norm_cv,      atmos_norm_rock, 
03295                                                     atmos_chg_cv,       atmos_chg_rock, 
03296                                                     atmos_nue_norm,     atmos_nue_ratio,     
03297                                                     atmos_ncbkg,
03298                                                     atmos_spec_cv_numu, atmos_spec_cv_numubar, 
03299                                                     atmos_spec_cv_nue,  atmos_spec_cv_nuebar, 
03300                                                     atmos_spec_rock_nu, atmos_spec_rock_nubar, 
03301                                                     atmos_zenith,
03302                                                     atmos_numu_trken,   atmos_numu_trken_exit, 
03303                                                     atmos_numu_shwen,   atmos_nue_energy,  
03304                                                     filename.Data() );
03305     }
03306   }
03307 
03308 
03309   // Shift the DeltaCP histogram
03310   // ---------------------------
03311   Double_t delta_DeltaCP = 0.005;
03312 
03313   for( Int_t i=0; i<hDeltaCP->GetYaxis()->GetNbins(); i++ ){
03314     for( Int_t j=0; j<hDeltaCP->GetXaxis()->GetNbins(); j++ ){ 
03315       osc_deltaCP = hDeltaCP->GetBinContent( j+1, i+1 );
03316    
03317       if( osc_deltaCP>2.0*TMath::Pi()-delta_DeltaCP ){
03318         hDeltaCP->SetBinContent( j+1, i+1, osc_deltaCP-2.0*TMath::Pi() );
03319       }
03320     }
03321   }
03322 
03323 
03324   // Gaussian 2-parameter C.L.
03325   // -------------------------
03326   TH2D* hLnL68 = (TH2D*)(hLnL->Clone("hLnL68")); 
03327   hLnL68->SetContour(1);
03328   hLnL68->SetContourLevel(0,fLnL68);
03329 
03330   TH2D* hLnL90 = (TH2D*)(hLnL->Clone("hLnL90"));
03331   hLnL90->SetContour(1);
03332   hLnL90->SetContourLevel(0,fLnL90);
03333 
03334   TH2D* hLnL99 = (TH2D*)(hLnL->Clone("hLnL99"));
03335   hLnL99->SetContour(1);
03336   hLnL99->SetContourLevel(0,fLnL99);
03337 
03338 
03339   // Write Output Histograms
03340   // =======================
03341   if( 1 ){ // always write this file...
03342 
03343     TString filename = fOutFile;
03344     TString tag = ".output";
03345   
03346     if( filename.EndsWith(".root") )
03347       filename.Insert(filename.Length()-5,tag);
03348     else filename.Append(tag);
03349 
03350     std::cout << " *** ThreeFlavourFitter::WriteContours() *** " << std::endl;
03351     std::cout << "   Writing Contours to File: " << filename.Data() << std::endl;
03352 
03353     TDirectory* tmpd = gDirectory;
03354     TFile* file = new TFile(filename.Data(),"recreate");
03355 
03356     hHierarchy->Write();
03357     hDmsq->Write(); 
03358     hSinsq23->Write();
03359     hSinsq13->Write();
03360     hDeltaCP->Write();
03361     hDeltaCP0->Write();
03362     hBeamNumuNorm->Write();
03363     hBeamNumuNCBkg->Write();
03364     hBeamNumuShwEn->Write();
03365     hBeamNumuTrkEn->Write();
03366     hBeamNumuTrkEnExit->Write();
03367     hBeamNueNorm->Write();
03368     hBeamNueNCBkg->Write();
03369     hBeamNueEnergy->Write();
03370     hAtmosNormCV->Write();
03371     hAtmosNormRock->Write();
03372     hAtmosChgCV->Write();
03373     hAtmosChgRock->Write();
03374     hAtmosNueNorm->Write();
03375     hAtmosNueRatio->Write();
03376     hAtmosNCBkg->Write();
03377     hAtmosSpecNumuCV->Write();
03378     hAtmosSpecNumuBarCV->Write();  
03379     hAtmosSpecNueCV->Write();
03380     hAtmosSpecNueBarCV->Write();   
03381     hAtmosSpecNuRock->Write();
03382     hAtmosSpecNuBarRock->Write();
03383     hAtmosZenith->Write();
03384     hAtmosNumuTrkEn->Write();
03385     hAtmosNumuTrkEnExit->Write();
03386     hAtmosNumuShwEn->Write();
03387     hAtmosNueEnergy->Write();
03388 
03389     hLnL->Write();
03390     hLnLTotal->Write();
03391     hLnL68->Write();
03392     hLnL90->Write();
03393     hLnL99->Write();
03394 
03395     file->Close();
03396     tmpd->cd();
03397   }
03398 
03399   return;
03400 }

void ThreeFlavourFitter::RunPseudoExpts ( Int_t  numExpts  ) 

Definition at line 3659 of file ThreeFlavourFitter.cxx.

References BuildExpt(), fOutFile, fSeedDeltaCP, fSeedDmsq, fSeedSinsq13, fSeedSinsq23, n, PrintSettings(), and RunFit().

03660 {  
03661   std::cout << " *** ThreeFlavourFitter::RunPseudoExpts() *** " << std::endl;
03662   
03663   // Print Settings
03664   // ==============
03665   this->PrintSettings();
03666   
03667 
03668   // Input/Output Parameters
03669   // =======================
03670   Double_t input_dmsq            = fSeedDmsq;
03671   Double_t input_sinsq23         = fSeedSinsq23;
03672   Double_t input_sinsq13         = fSeedSinsq13;
03673   Double_t input_deltaCP         = fSeedDeltaCP;
03674   Double_t osc_dmsq              = 0.0;
03675   Double_t osc_sinsq23           = 0.0;
03676   Double_t osc_sinsq13           = 0.0;
03677   Double_t osc_deltaCP           = 0.0;
03678   Double_t beam_numu_norm        = 0.0;   
03679   Double_t beam_numu_ncbkg       = 0.0; 
03680   Double_t beam_numu_shwen       = 0.0;
03681   Double_t beam_numu_trken       = 0.0; 
03682   Double_t beam_numu_trken_exit  = 0.0; 
03683   Double_t beam_nue_norm         = 0.0;   
03684   Double_t beam_nue_ncbkg        = 0.0; 
03685   Double_t beam_nue_energy       = 0.0;
03686   Double_t atmos_norm_cv         = 0.0;
03687   Double_t atmos_norm_rock       = 0.0;
03688   Double_t atmos_chg_cv          = 0.0;
03689   Double_t atmos_chg_rock        = 0.0;
03690   Double_t atmos_nue_norm        = 0.0;
03691   Double_t atmos_nue_ratio       = 0.0;
03692   Double_t atmos_ncbkg           = 0.0;
03693   Double_t atmos_spec_cv_numu    = 0.0;
03694   Double_t atmos_spec_cv_numubar = 0.0;
03695   Double_t atmos_spec_cv_nue     = 0.0;
03696   Double_t atmos_spec_cv_nuebar  = 0.0;
03697   Double_t atmos_spec_rock_nu    = 0.0;
03698   Double_t atmos_spec_rock_nubar = 0.0;
03699   Double_t atmos_zenith          = 0.0;
03700   Double_t atmos_numu_trken      = 0.0;
03701   Double_t atmos_numu_trken_exit = 0.0;
03702   Double_t atmos_numu_shwen      = 0.0;
03703   Double_t atmos_nue_energy      = 0.0;
03704   Double_t LnL                   = 0.0;
03705 
03706 
03707   // Create Output File
03708   // ==================
03709   TString filename = fOutFile;
03710   TDirectory* tmpd = 0;
03711 
03712   tmpd = gDirectory;
03713   TFile* file = new TFile(filename.Data(),"recreate");
03714   TTree* tree = new TTree("PseudoExpts","fits to pseudo-experiments");
03715 
03716   tree->Branch("input_dmsq",&input_dmsq,"input_dmsq/D");
03717   tree->Branch("input_sinsq23",&input_sinsq23,"input_sinsq23/D");
03718   tree->Branch("input_sinsq13",&input_sinsq13,"input_sinsq13/D");
03719   tree->Branch("input_deltaCP",&input_deltaCP,"input_deltaCP/D");
03720   tree->Branch("osc_dmsq",&osc_dmsq,"osc_dmsq/D");
03721   tree->Branch("osc_sinsq23",&osc_sinsq23,"osc_sinsq23/D");
03722   tree->Branch("osc_sinsq13",&osc_sinsq13,"osc_sinsq13/D");
03723   tree->Branch("osc_deltaCP",&osc_deltaCP,"osc_deltaCP/D");
03724   tree->Branch("beam_numu_norm",&beam_numu_norm,"beam_numu_norm/D");
03725   tree->Branch("beam_numu_ncbkg",&beam_numu_ncbkg,"beam_numu_ncbkg/D");
03726   tree->Branch("beam_numu_shwen",&beam_numu_shwen,"beam_numu_shwen/D");
03727   tree->Branch("beam_numu_trken",&beam_numu_trken,"beam_numu_trken/D");
03728   tree->Branch("beam_numu_trken_exit",&beam_numu_trken_exit,"beam_numu_trken_exit/D");
03729   tree->Branch("beam_nue_norm",&beam_nue_norm,"beam_nue_norm/D");
03730   tree->Branch("beam_nue_ncbkg",&beam_nue_ncbkg,"beam_nue_ncbkg/D");
03731   tree->Branch("beam_nue_energy",&beam_nue_energy,"beam_nue_energy/D");
03732   tree->Branch("atmos_norm_cv",&atmos_norm_cv,"atmos_norm_cv/D");
03733   tree->Branch("atmos_norm_rock",&atmos_norm_rock,"atmos_norm_rock/D");
03734   tree->Branch("atmos_chg_cv",&atmos_chg_cv,"atmos_chg_cv/D");
03735   tree->Branch("atmos_chg_rock",&atmos_chg_rock,"atmos_chg_rock/D");
03736   tree->Branch("atmos_nue_norm",&atmos_nue_norm,"atmos_nue_norm/D");
03737   tree->Branch("atmos_nue_ratio",&atmos_nue_ratio,"atmos_nue_ratio/D");
03738   tree->Branch("atmos_ncbkg",&atmos_ncbkg,"atmos_ncbkg/D");
03739   tree->Branch("atmos_spec_cv_numu",&atmos_spec_cv_numu,"atmos_spec_cv_numu/D");
03740   tree->Branch("atmos_spec_cv_numubar",&atmos_spec_cv_numubar,"atmos_spec_cv_numubar/D");
03741   tree->Branch("atmos_spec_cv_nue",&atmos_spec_cv_nue,"atmos_spec_cv_nue/D");
03742   tree->Branch("atmos_spec_cv_nuebar",&atmos_spec_cv_nuebar,"atmos_spec_cv_nuebar/D");
03743   tree->Branch("atmos_spec_rock_nu",&atmos_spec_rock_nu,"atmos_spec_rock_nu/D");
03744   tree->Branch("atmos_spec_rock_nubar",&atmos_spec_rock_nubar,"atmos_spec_rock_nubar/D");
03745   tree->Branch("atmos_zenith",&atmos_zenith,"atmos_zenith/D");
03746   tree->Branch("atmos_numu_trken",&atmos_numu_trken,"atmos_numu_trken/D");
03747   tree->Branch("atmos_numu_trken_exit",&atmos_numu_trken_exit,"atmos_numu_trken_exit/D");
03748   tree->Branch("atmos_numu_shwen",&atmos_numu_shwen,"atmos_numu_shwen/D");
03749   tree->Branch("atmos_nue_energy",&atmos_nue_energy,"atmos_nue_energy/D");
03750   tree->Branch("LnL",&LnL,"LnL/D");
03751   gDirectory = tmpd;   
03752 
03753 
03754 
03755   // Run Pseudo-Experiments
03756   // ======================
03757   for( Int_t n=0; n<numExpts; n++ ){
03758     std::cout << " --- NEW EXPERIMENT [" << n << "] --- " << std::endl;
03759 
03760     this->BuildExpt();
03761 
03762     this->RunFit( input_dmsq,         input_sinsq23,
03763                   input_sinsq13,      input_deltaCP,
03764                   osc_dmsq,           osc_sinsq23,
03765                   osc_sinsq13,        osc_deltaCP,
03766                   beam_numu_norm,     beam_numu_ncbkg,
03767                   beam_numu_shwen,    beam_numu_trken,
03768                   beam_numu_trken_exit,
03769                   beam_nue_norm,      beam_nue_ncbkg,
03770                   beam_nue_energy,
03771                   atmos_norm_cv,      atmos_norm_rock, 
03772                   atmos_chg_cv,       atmos_chg_rock, 
03773                   atmos_nue_norm,     atmos_nue_ratio,        
03774                   atmos_ncbkg,
03775                   atmos_spec_cv_numu, atmos_spec_cv_numubar,
03776                   atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
03777                   atmos_spec_rock_nu, atmos_spec_rock_nubar,
03778                   atmos_zenith,
03779                   atmos_numu_trken,   atmos_numu_trken_exit,
03780                   atmos_numu_shwen,   atmos_nue_energy,  
03781                   LnL );
03782 
03783     std::cout << " --- RESULTS: dmsq=" << osc_dmsq << " sinsq23=" << osc_sinsq23 << " sinsq13=" << osc_sinsq13 << " deltaCP=" << osc_deltaCP << " LnL=" << LnL << std::endl; 
03784 
03785     tmpd = gDirectory; 
03786     file->cd();
03787     tree->Fill();
03788     gDirectory = tmpd;
03789   }
03790 
03791 
03792   // Write Output File
03793   // =================
03794   tmpd = gDirectory;
03795   file->cd();
03796   tree->Write();
03797   file->Close();
03798   gDirectory = tmpd;
03799 
03800   return;
03801 }

void ThreeFlavourFitter::RunTemplates (  ) 

Definition at line 3402 of file ThreeFlavourFitter.cxx.

References BuildExpt(), fOutFile, fTemplateExpt, Instance(), and TouchExpt().

Referenced by RunFit(), and RunOscFit().

03403 {
03404   std::cout << " *** ThreeFlavourFitter::RunTemplates() *** " << std::endl;  
03405 
03406   // Build Experiment
03407   // ================
03408   if( this->TouchExpt()==0 ){
03409     this->BuildExpt();
03410   }
03411   
03412   // Write Experiment
03413   // ================
03414   TString filename = fOutFile;
03415   TString tag = "";
03416   
03417   // data
03418   filename = fOutFile;
03419   tag = ".expt";
03420   
03421   if( filename.EndsWith(".root") )
03422     filename.Insert(filename.Length()-5,tag);
03423   else filename.Append(tag);
03424 
03425   std::cout << " *** ThreeFlavourFitter::RunTemplates() 2 *** " << std::endl;  
03426   
03427   TemplateWriter::Instance()->Write( fTemplateExpt,
03428                                      filename.Data() );
03429 
03430   // no oscillations
03431   filename = fOutFile;
03432   tag = ".noosc";
03433   
03434   if( filename.EndsWith(".root") )
03435     filename.Insert(filename.Length()-5,tag);
03436   else filename.Append(tag);
03437 
03438   std::cout << " *** ThreeFlavourFitter::RunTemplates() 3 *** " << std::endl;  
03439   
03440   TemplateWriter::Instance()->WriteExpectation( filename.Data() ); 
03441 
03442   // NC background
03443   filename = fOutFile;
03444   tag = ".ncbkg";
03445   
03446   if( filename.EndsWith(".root") )
03447     filename.Insert(filename.Length()-5,tag);
03448   else filename.Append(tag);
03449 
03450   TemplateWriter::Instance()->WriteNCBackground( filename.Data() );
03451 
03452   // Cosmic background
03453   filename = fOutFile;
03454   tag = ".cosmic";
03455   
03456   if( filename.EndsWith(".root") )
03457     filename.Insert(filename.Length()-5,tag);
03458   else filename.Append(tag);
03459 
03460   TemplateWriter::Instance()->WriteCosmicBackground( filename.Data() );
03461 
03462   return;
03463 }

void ThreeFlavourFitter::RunTest (  ) 

Definition at line 421 of file ThreeFlavourFitter.cxx.

00422 {
00423   std::cout << " *** ThreeFlavourFitter::RunTest() *** " << std::endl;
00424 }

void OscFit::ThreeFlavourFitter::SetAtmosSystematics ( Double_t  atmos_norm_cv,
Double_t  atmos_norm_rock,
Double_t  atmos_chg_cv,
Double_t  atmos_chg_rock,
Double_t  atmos_nue_norm,
Double_t  atmos_nue_ratio,
Double_t  atmos_ncbkg,
Double_t  atmos_spec_cv_numu,
Double_t  atmos_spec_cv_numubar,
Double_t  atmos_spec_cv_nue,
Double_t  atmos_spec_cv_nuebar,
Double_t  atmos_spec_rock_nu,
Double_t  atmos_spec_rock_nubar,
Double_t  atmos_zenith,
Double_t  atmos_numu_trken,
Double_t  atmos_numu_trken_exit,
Double_t  atmos_numu_shwen,
Double_t  atmos_nue_energy 
) [inline]

Definition at line 200 of file ThreeFlavourFitter.h.

References fInputAtmosChgCV, fInputAtmosChgRock, fInputAtmosNCBkg, fInputAtmosNormCV, fInputAtmosNormRock, fInputAtmosNueEnergy, fInputAtmosNueNorm, fInputAtmosNueRatio, fInputAtmosNumuShwEn, fInputAtmosNumuTrkEn, fInputAtmosNumuTrkEnExit, fInputAtmosSpecNuBarRock, fInputAtmosSpecNueBarCV, fInputAtmosSpecNueCV, fInputAtmosSpecNumuBarCV, fInputAtmosSpecNumuCV, fInputAtmosSpecNuRock, and fInputAtmosZenith.

Referenced by SetInputSystematics().

00209                                                                                       {
00210       fInputAtmosNormCV        = atmos_norm_cv;
00211       fInputAtmosNormRock      = atmos_norm_rock;
00212       fInputAtmosChgCV         = atmos_chg_cv;
00213       fInputAtmosChgRock       = atmos_chg_rock;
00214       fInputAtmosNueNorm       = atmos_nue_norm;
00215       fInputAtmosNueRatio      = atmos_nue_ratio;
00216       fInputAtmosNCBkg         = atmos_ncbkg;
00217       fInputAtmosSpecNumuCV    = atmos_spec_cv_numu;
00218       fInputAtmosSpecNumuBarCV = atmos_spec_cv_numubar;
00219       fInputAtmosSpecNueCV     = atmos_spec_cv_nue;
00220       fInputAtmosSpecNueBarCV  = atmos_spec_cv_nuebar;
00221       fInputAtmosSpecNuRock    = atmos_spec_rock_nu;
00222       fInputAtmosSpecNuBarRock = atmos_spec_rock_nubar;
00223       fInputAtmosZenith        = atmos_zenith;
00224       fInputAtmosNumuTrkEn     = atmos_numu_trken;
00225       fInputAtmosNumuTrkEnExit = atmos_numu_trken_exit;
00226       fInputAtmosNumuShwEn     = atmos_numu_shwen;
00227       fInputAtmosNueEnergy     = atmos_nue_energy;     
00228     }

void OscFit::ThreeFlavourFitter::SetBeamSystematics ( Double_t  beam_numu_norm,
Double_t  beam_numu_ncbkg,
Double_t  beam_numu_shwen,
Double_t  beam_numu_trken,
Double_t  beam_numu_trken_exit,
Double_t  beam_nue_norm,
Double_t  beam_nue_ncbkg,
Double_t  beam_nue_energy 
) [inline]

Definition at line 185 of file ThreeFlavourFitter.h.

References fInputBeamNueEnergy, fInputBeamNueNCBkg, fInputBeamNueNorm, fInputBeamNumuNCBkg, fInputBeamNumuNorm, fInputBeamNumuShwEn, fInputBeamNumuTrkEn, and fInputBeamNumuTrkEnExit.

Referenced by SetInputSystematics().

00189                                                        {
00190       fInputBeamNumuNorm      = beam_numu_norm;   
00191       fInputBeamNumuNCBkg     = beam_numu_ncbkg;
00192       fInputBeamNumuShwEn     = beam_numu_shwen;   
00193       fInputBeamNumuTrkEn     = beam_numu_trken;
00194       fInputBeamNumuTrkEnExit = beam_numu_trken_exit;
00195       fInputBeamNueNorm       = beam_nue_norm;   
00196       fInputBeamNueNCBkg      = beam_nue_ncbkg;
00197       fInputBeamNueEnergy     = beam_nue_energy;
00198     }

void OscFit::ThreeFlavourFitter::SetDebug ( Bool_t  yesno = 1  )  [inline]

Definition at line 506 of file ThreeFlavourFitter.h.

References fDebug.

00506                                       {
00507       fDebug = yesno;
00508     }

void ThreeFlavourFitter::SetExternalConstraintOnSinsq13 ( Double_t  sinsqTheta,
Double_t  sinsqThetaError 
)

Definition at line 797 of file ThreeFlavourFitter.cxx.

References fExternalConstraints, fExternalSinsq13, and fExternalSinsq13Error.

00798 {
00799   fExternalConstraints  = true;
00800   fExternalSinsq13      = sinsqTheta;
00801   fExternalSinsq13Error = sinsqThetaError;
00802 }

void ThreeFlavourFitter::SetExternalConstraintOnSinsq13 ( Double_t  sinsqThetaError  ) 

Definition at line 790 of file ThreeFlavourFitter.cxx.

References fExternalConstraints, fExternalSinsq13, fExternalSinsq13Error, and OscFit::Sinsq13().

00791 {
00792   fExternalConstraints  = true;
00793   fExternalSinsq13      = OscFit::Sinsq13();
00794   fExternalSinsq13Error = sinsqThetaError;
00795 }

void OscFit::ThreeFlavourFitter::SetFileName ( const char *  filename  )  [inline]

Definition at line 18 of file ThreeFlavourFitter.h.

References fOutFile.

00018                                              {
00019       fOutFile = filename;
00020     }

void OscFit::ThreeFlavourFitter::SetInputOscillations ( Double_t  dmsq,
Double_t  sinsq23,
Double_t  sinsq13,
Double_t  deltaCP 
) [inline]

Definition at line 115 of file ThreeFlavourFitter.h.

References fInputDeltaCP, fInputDmsq, fInputSinsq13, and fInputSinsq23.

Referenced by SetOscillations().

00116                                                                     {
00117       fInputDmsq = dmsq;  fInputSinsq23 = sinsq23; 
00118       fInputSinsq13 = sinsq13;  fInputDeltaCP = deltaCP; 
00119     }

void OscFit::ThreeFlavourFitter::SetInputSystematics ( Double_t  beam_numu_norm,
Double_t  beam_numu_ncbkg,
Double_t  beam_numu_shwen,
Double_t  beam_numu_trken,
Double_t  beam_numu_trken_exit,
Double_t  beam_nue_norm,
Double_t  beam_nue_ncbkg,
Double_t  beam_nue_energy,
Double_t  atmos_norm_cv,
Double_t  atmos_norm_rock,
Double_t  atmos_chg_cv,
Double_t  atmos_chg_rock,
Double_t  atmos_nue_norm,
Double_t  atmos_nue_ratio,
Double_t  atmos_ncbkg,
Double_t  atmos_spec_cv_numu,
Double_t  atmos_spec_cv_numubar,
Double_t  atmos_spec_cv_nue,
Double_t  atmos_spec_cv_nuebar,
Double_t  atmos_spec_rock_nu,
Double_t  atmos_spec_rock_nubar,
Double_t  atmos_zenith,
Double_t  atmos_numu_trken,
Double_t  atmos_numu_trken_exit,
Double_t  atmos_numu_shwen,
Double_t  atmos_nue_energy 
) [inline]

Definition at line 153 of file ThreeFlavourFitter.h.

References SetAtmosSystematics(), and SetBeamSystematics().

Referenced by SetSystematics().

00167                                                                                       {
00168       SetBeamSystematics( beam_numu_norm,     beam_numu_ncbkg,
00169                           beam_numu_shwen,    beam_numu_trken,
00170                           beam_numu_trken_exit,
00171                           beam_nue_norm,      beam_nue_ncbkg,
00172                           beam_nue_energy );
00173       SetAtmosSystematics( atmos_norm_cv,      atmos_norm_rock, 
00174                            atmos_chg_cv,       atmos_chg_rock, 
00175                            atmos_nue_norm,     atmos_nue_ratio,  
00176                            atmos_ncbkg,
00177                            atmos_spec_cv_numu, atmos_spec_cv_numubar,
00178                            atmos_spec_cv_nue,  atmos_spec_cv_nuebar,
00179                            atmos_spec_rock_nu, atmos_spec_rock_nubar,
00180                            atmos_zenith,
00181                            atmos_numu_trken,   atmos_numu_trken_exit,
00182                            atmos_numu_shwen,   atmos_nue_energy );
00183     }

void OscFit::ThreeFlavourFitter::SetMockData (  )  [inline]

Definition at line 77 of file ThreeFlavourFitter.h.

References fMockData, and fMockDataWithFluctuations.

00077                        { 
00078       fMockData = 1; 
00079       fMockDataWithFluctuations = 0;
00080     }

void OscFit::ThreeFlavourFitter::SetMockDataWithFluctuations (  )  [inline]

Definition at line 82 of file ThreeFlavourFitter.h.

References fMockData, and