NC::CoordinateConverter Class Reference

Convert from CoordNDim to SystPars and OscPars. More...

#include <NCCoordinateConverter.h>

List of all members.

Public Member Functions

 CoordinateConverter ()
virtual ~CoordinateConverter ()
void Prepare (const Registry &r, bool hush=false)
SystPars SystParsFromCoordNDim (const Fitter::CoordNDim &coord) const
 Translates between fitter's coordinates and systematic parameters.
OscProb::OscParsOscParsFromCoordNDim (const Fitter::CoordNDim &coords) const
 Translates between fitter's coordinates and oscillation parameters.
Fitter::CoordNDim CoordNDimFromOscPars (const OscProb::OscPars *pars) const
 Translates between oscillation parameters and fitter's coordinates.
int FitterIndex (NCType::EFitParam par) const
NCParameter ParameterForFitterIndex (int idx) const
NCParameter ParameterForFitParam (NCType::EFitParam par) const
bool IsFit (NCType::EFitParam par) const
int NumParameters () const
bool IsSystematic (NCType::EFitParam par) const
TH1 * AxesForParameter (TString name, TString title, NCType::EFitParam x, TString yAx) const
TH1 * AxesForParameter (TString name, TString title, int x, TString yAx) const
TH2 * AxesForParameters (TString name, TString title, int x, int y) const
TH2 * AxesForParameters (TString name, TString title, NCType::EFitParam x, NCType::EFitParam y) const
std::vector< double > VectorFromSystPars (const NC::SystPars &s) const

Static Public Member Functions

static const RegistryDefaultConfig ()

Public Attributes

std::vector< NCParameterfFitParams
 List of details of parameters used in the fit.

Private Member Functions

int AddParameter (std::string shortName, std::string latexName, double min, double max, double prec, bool limit)
 Add an NCParameter with this description to fFitParams and return its index.
int AddSystematicParameter (NCType::EFitParam)
 Look up the systematic parameter and then forward to AddParameter.
void TryAddSystematic (const Registry &r, NCType::EFitParam p)
 Add systematic p to fFitParams if r thinks we should.
void PrepareSystematics (const Registry &r)
 Adds the systematics requested in r to fFitParams.
void PrepareOscillations (const Registry &r)
 Adds the systematics required for fOscillationModel to fFitParams.
double ChooseValue (NCType::EFitParam param, const NC::Fitter::CoordNDim &coords) const
 Return fixed value of param if not fit, else value from coords.

Private Attributes

int fLoc [NCType::kNumParameters]
 Mapping from EFitParam constants to fitter coordinate indices.
double fFixedVals [NCType::kNumParameters]
 Mapping from EFitParam constants to fixed value, if the parameter is not fit.
NCType::EOscModel fOscillationModel
double fPrecScale

Detailed Description

Convert from CoordNDim to SystPars and OscPars.

Definition at line 68 of file NCCoordinateConverter.h.


Constructor & Destructor Documentation

NC::CoordinateConverter::CoordinateConverter (  ) 

Definition at line 100 of file NCCoordinateConverter.cxx.

References fFixedVals, fLoc, NCType::kNumParameters, and n.

00101 {
00102   for(int n = 0; n < kNumParameters; ++n){
00103     fLoc[n] = -1;
00104     fFixedVals[n] = -9999;
00105   }
00106 }

virtual NC::CoordinateConverter::~CoordinateConverter (  )  [inline, virtual]

Definition at line 72 of file NCCoordinateConverter.h.

00072 {}


Member Function Documentation

int NC::CoordinateConverter::AddParameter ( std::string  shortName,
std::string  latexName,
double  min,
double  max,
double  prec,
bool  limit 
) [private]

Add an NCParameter with this description to fFitParams and return its index.

Referenced by AddSystematicParameter(), and PrepareOscillations().

int NC::CoordinateConverter::AddSystematicParameter ( NCType::EFitParam  p  )  [private]

Look up the systematic parameter and then forward to AddParameter.

Definition at line 642 of file NCCoordinateConverter.cxx.

References AddParameter(), NCType::kParams, NCType::ParamDef::latexName, and NCType::ParamDef::sigma.

Referenced by TryAddSystematic().

00643 {
00644   const double sigma = kParams[p].sigma;
00645   return AddParameter(kParams[p].name.Data(), kParams[p].latexName.Data(),
00646                       -sigma, sigma, -1, false);
00647 }

TH1 * NC::CoordinateConverter::AxesForParameter ( TString  name,
TString  title,
int  x,
TString  yAx 
) const

Definition at line 677 of file NCCoordinateConverter.cxx.

References AxesForNCParameter(), and ParameterForFitterIndex().

00681 {
00682   const NCParameter xp = ParameterForFitterIndex(x);
00683 
00684   return AxesForNCParameter(name, title, xp, yLabel);
00685 }

TH1 * NC::CoordinateConverter::AxesForParameter ( TString  name,
TString  title,
NCType::EFitParam  x,
TString  yAx 
) const

Definition at line 666 of file NCCoordinateConverter.cxx.

References AxesForNCParameter(), and ParameterForFitParam().

00670 {
00671   const NCParameter xp = ParameterForFitParam(x);
00672 
00673   return AxesForNCParameter(name, title, xp, yLabel);
00674 }

TH2 * NC::CoordinateConverter::AxesForParameters ( TString  name,
TString  title,
NCType::EFitParam  x,
NCType::EFitParam  y 
) const

Definition at line 706 of file NCCoordinateConverter.cxx.

References AxesForNCParameters(), and ParameterForFitParam().

00710 {
00711   const NCParameter xp = ParameterForFitParam(x);
00712   const NCParameter yp = ParameterForFitParam(y);
00713 
00714   return AxesForNCParameters(name, title, xp, yp);
00715 }

TH2 * NC::CoordinateConverter::AxesForParameters ( TString  name,
TString  title,
int  x,
int  y 
) const

Definition at line 718 of file NCCoordinateConverter.cxx.

References AxesForNCParameters(), and ParameterForFitterIndex().

Referenced by NC::FitMaster::DrawAndWriteContourGraphs().

00721 {
00722   const NCParameter xp = ParameterForFitterIndex(x);
00723   const NCParameter yp = ParameterForFitterIndex(y);
00724 
00725   return AxesForNCParameters(name, title, xp, yp);
00726 }

double NC::CoordinateConverter::ChooseValue ( NCType::EFitParam  param,
const NC::Fitter::CoordNDim coords 
) const [private]

Return fixed value of param if not fit, else value from coords.

Definition at line 338 of file NCCoordinateConverter.cxx.

References fFixedVals, fLoc, and IsFit().

Referenced by OscParsFromCoordNDim().

00339 {
00340   if(IsFit(param))
00341     return coords.at(fLoc[param]);
00342   else
00343     return fFixedVals[param];
00344 }

CoordNDim NC::CoordinateConverter::CoordNDimFromOscPars ( const OscProb::OscPars pars  )  const

Translates between oscillation parameters and fitter's coordinates.

pars must be the same model as fOscillationModel

Todo:
Doesn't handle systematic parameters, so care must be taken when using the returned coordinate.
See also:
OscParsFromCoordNDim

Definition at line 553 of file NCCoordinateConverter.cxx.

References FitterIndex(), fOscillationModel, NC::OscProb::OscPars::GetParameterValue(), IsFit(), IsSystematic(), NCType::kDeltaMSqr, NCType::kDeltaMSqr12, NCType::kDeltaMSqr31, NCType::kDeltaMSqr32, NCType::kDeltaMSqr41, NCType::kDeltaMSqr43, NCType::kNumParameters, n, and NC::OscProb::OscPars::OscillationModel().

Referenced by NC::FitMaster::MargWithFixedVals(), and NC::FitMaster::Run().

00554 {
00555   assert(pars->OscillationModel() == fOscillationModel);
00556 
00557   CoordNDim ret;
00558 
00559   using namespace NCType;
00560 
00561   for(int n = 0; n < kNumParameters; ++n){
00562     const EFitParam par = EFitParam(n);
00563     if(IsFit(par) && !IsSystematic(par)){
00564       const unsigned int loc = FitterIndex(par);
00565       if(ret.size() <= loc) ret.resize(loc+1);
00566       double parval = pars->GetParameterValue(par);
00567       // Have to undo 1e3 factor in deltam values. TODO better
00568       if(par == kDeltaMSqr || par == kDeltaMSqr12 || par == kDeltaMSqr31 ||
00569          par == kDeltaMSqr32 || par == kDeltaMSqr41 || par == kDeltaMSqr43)
00570         parval *= 1e3;
00571       ret[loc] = parval;
00572     }
00573   }
00574 
00575   return ret;
00576 }

const Registry & NC::CoordinateConverter::DefaultConfig ( void   )  [static]

Definition at line 109 of file NCCoordinateConverter.cxx.

References Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

Referenced by NC::FitMaster::DefaultConfig().

00110 {
00111   static Registry r;
00112 
00113   r.UnLockValues();
00114 
00115   r.Set("PrecScale",         1.0);
00116 
00117   r.Set("DeltaCP3FlavorVal", 0.0);
00118 
00119   // Whether to fit particular parameters
00120   r.Set("FitUE3Sqr",            false);
00121   r.Set("FitTheta13",           false);
00122   r.Set("FitDelta1",            false);
00123   r.Set("FitDelta2",            false);
00124 
00125   r.Set("FitTheta14",           true);
00126   r.Set("FitTheta24",           true);
00127   r.Set("FitTheta23",           true);
00128 
00129   // Fixed values to use for the parameters if not fitting them
00130   r.Set("UE3SqrVal",            0.);
00131   r.Set("Theta13Val",           0.);
00132   r.Set("Delta1Val",            0.);
00133   r.Set("Delta2Val",            0.);
00134 
00135   r.Set("Theta14Val",           0.);
00136   r.Set("Theta24Val",           0.);
00137   r.Set("Theta23Val",           0.);
00138 
00139 
00140   r.LockValues();
00141   return r;
00142 }

int NC::CoordinateConverter::FitterIndex ( NCType::EFitParam  par  )  const

Definition at line 579 of file NCCoordinateConverter.cxx.

References fLoc, and NCType::kNumParameters.

Referenced by CoordNDimFromOscPars(), NC::FitMaster::DrawAndWriteContourGraphs(), NC::FitMaster::GetContourMinuit(), NC::FitMaster::MargWithFixedVals(), ParameterForFitParam(), and NC::FitMaster::Run().

00580 {
00581   assert(int(par) >= 0 && par < kNumParameters);
00582   assert(fLoc[par] != -1);
00583   return fLoc[par];
00584 }

bool NC::CoordinateConverter::IsFit ( NCType::EFitParam  par  )  const

Definition at line 602 of file NCCoordinateConverter.cxx.

References fLoc.

Referenced by ChooseValue(), CoordNDimFromOscPars(), NumParameters(), SystParsFromCoordNDim(), and VectorFromSystPars().

00603 {
00604   return fLoc[par] != -1;
00605 }

bool NC::CoordinateConverter::IsSystematic ( NCType::EFitParam  par  )  const
int NC::CoordinateConverter::NumParameters (  )  const

Definition at line 608 of file NCCoordinateConverter.cxx.

References IsFit(), NCType::kNumParameters, and n.

00609 {
00610   int fit = 0;
00611   for(int n = 0; n < NCType::kNumParameters; ++n)
00612     if(IsFit(NCType::EFitParam(n))) ++fit;
00613   return fit;
00614 }

NC::OscProb::OscPars * NC::CoordinateConverter::OscParsFromCoordNDim ( const Fitter::CoordNDim coords  )  const

Translates between fitter's coordinates and oscillation parameters.

Caller is responsible for deleting the returned parameters

See also:
CoordNDimFromOscPars

Definition at line 401 of file NCCoordinateConverter.cxx.

References ChooseValue(), MuELoss::e, fFixedVals, fLoc, fOscillationModel, NCType::kAlpha, NCType::kDecay, NCType::kDecoherence, NCType::kDelta1, NCType::kDelta13, NCType::kDelta2, NCType::kDeltaMSqr, NCType::kDeltaMSqr31, NCType::kDeltaMSqr32, NCType::kDeltaMSqr41, NCType::kDeltaMSqr43, Msg::kError, NCType::kFourFlavorDelta41Is0, NCType::kFourFlavorDelta43Is0, NCType::kFourFlavorDelta43IsBig, NCType::kFourFlavorGeneral, NCType::kFs, NCType::kMu, NCType::kNoOscillations, NCType::kSterileFraction, NCType::kSterileFractionTauNorm, NCType::kTauScale, kTheta, NCType::kTheta13, NCType::kTheta14, NCType::kTheta23, NCType::kTheta24, NCType::kTheta34, NCType::kThreeFlavor, NCType::kUE3Sqr, NCType::kUMu3Sqr, MSG, and UtilMisc::OscProb().

Referenced by NC::GetChiSqrFromDerived::EvalAtEx(), NCExtrapolation::GetBestFitOscPars(), NCExtrapolation::SetBestFitCoordNDim(), and NC::FitMaster::SetBestFitCoordNDim().

00402 {
00403   using namespace NC::OscProb;
00404 
00405   // This can happen if eg we didn't do a fit. It's still the callers'
00406   // fault, but this is more polite than the alternatives (crashing).
00407   if(coords.empty() && fOscillationModel != kNoOscillations) return 0;
00408 
00409   try{
00410     switch(fOscillationModel){
00411     case kThreeFlavor:{
00412       ThreeFlavor* pars = new ThreeFlavor;
00413 
00414       pars->Theta23() = ChooseValue(kTheta23, coords);
00415       pars->DeltaMSqr32() = coords.at(fLoc[kDeltaMSqr32])*1.e-3;
00416 
00417       pars->Theta13() = ChooseValue(kTheta13, coords);
00418 
00419       pars->Theta12() = 0.61; //SNO+KamLAND
00420       pars->DeltaMSqr12() = 7.59e-5;//SNO+KamLAND
00421       pars->RockDensity() = 2.7;//g/cc standard rock
00422       pars->Delta13() = fFixedVals[kDelta13];//cp violating phase
00423       pars->Hierarchy()  = 1;
00424 
00425       return pars;
00426     }
00427 
00428     case kNoOscillations:{
00429       return new NoOscillations;
00430     }
00431 
00432     case kFourFlavorGeneral:{
00433       FourFlavorGeneral* pars = new FourFlavorGeneral;
00434 
00435       pars->Theta13() = ChooseValue(kTheta13, coords);
00436       pars->Delta1() =  ChooseValue(kDelta1,  coords);
00437       pars->Delta2() =  ChooseValue(kDelta2,  coords);
00438       pars->Theta14() = ChooseValue(kTheta14, coords);
00439 
00440       pars->Theta23() = ChooseValue(kTheta23, coords);
00441       pars->Theta24() = ChooseValue(kTheta24, coords);
00442       pars->Theta34() = coords.at(fLoc[kTheta34]);
00443       pars->DeltaMSqr31() = coords.at(fLoc[kDeltaMSqr31])*1e-3;
00444       pars->DeltaMSqr41() = coords.at(fLoc[kDeltaMSqr41])*1e-3;
00445       pars->DeltaMSqr43() = coords.at(fLoc[kDeltaMSqr43])*1e-3;
00446 
00447       return pars;
00448     }
00449 
00450     case kFourFlavorDelta43IsBig:{
00451       FourFlavorDelta43IsBig* pars = new FourFlavorDelta43IsBig;
00452 
00453       pars->Theta13() = ChooseValue(kTheta13, coords);
00454       pars->Delta1() =  ChooseValue(kDelta1,  coords);
00455       pars->Delta2() =  ChooseValue(kDelta2,  coords);
00456       pars->Theta14() = ChooseValue(kTheta14, coords);
00457 
00458       pars->Theta23() = ChooseValue(kTheta23, coords);
00459       pars->Theta24() = ChooseValue(kTheta24, coords);
00460       pars->Theta34() = coords.at(fLoc[kTheta34]);
00461       pars->DeltaMSqr31() = coords.at(fLoc[kDeltaMSqr31])*1e-3;
00462 
00463       return pars;
00464     }
00465 
00466     case kFourFlavorDelta41Is0:{
00467       FourFlavorDelta41Is0* pars = new FourFlavorDelta41Is0;
00468 
00469       pars->Theta13() = ChooseValue(kTheta13, coords);
00470 
00471       pars->Theta23() = ChooseValue(kTheta23, coords);
00472       pars->Theta34() = coords.at(fLoc[kTheta34]);
00473       pars->DeltaMSqr31() = coords.at(fLoc[kDeltaMSqr31])*1e-3;
00474 
00475       return pars;
00476     }
00477 
00478     case kFourFlavorDelta43Is0:{
00479       FourFlavorDelta43Is0* pars = new FourFlavorDelta43Is0;
00480 
00481       pars->Theta13() = ChooseValue(kTheta13, coords);
00482       pars->Delta1() =  ChooseValue(kDelta1,  coords);
00483       pars->Theta14() = ChooseValue(kTheta14, coords);
00484 
00485       pars->Theta23() = ChooseValue(kTheta23, coords);
00486       pars->Theta24() = ChooseValue(kTheta24, coords);
00487       pars->DeltaMSqr31() = coords.at(fLoc[kDeltaMSqr31])*1e-3;
00488 
00489       return pars;
00490     }
00491 
00492     case kSterileFraction:{
00493       SterileFraction* pars = new SterileFraction;
00494 
00495       pars->UE3Sqr() = ChooseValue(kUE3Sqr, coords);
00496 
00497       pars->UMu3Sqr() = coords.at(fLoc[kUMu3Sqr]);
00498       pars->DeltaMSqr32() = coords.at(fLoc[kDeltaMSqr32])*1.e-3;
00499       pars->Fs() = coords.at(fLoc[kFs]);
00500 
00501 
00502       return pars;
00503     }
00504 
00505     case kDecay:{
00506       Decay* pars = new Decay;
00507 
00508       pars->Theta() = coords.at(fLoc[kTheta]);
00509       pars->Alpha() = coords.at(fLoc[kAlpha]);
00510       pars->DeltaMSqr() = coords.at(fLoc[kDeltaMSqr])*1e-3;
00511 
00512       return pars;
00513     }
00514 
00515     case kSterileFractionTauNorm:{
00516       SterileFractionTauNorm* pars = new SterileFractionTauNorm;
00517 
00518       pars->UMu3Sqr() = coords.at(fLoc[kUMu3Sqr]);
00519       pars->DeltaMSqr32() = coords.at(fLoc[kDeltaMSqr32])*1.e-3;
00520       pars->Fs() = 0;//coords.at(fLoc[kFs]);
00521       pars->TauScale() = coords.at(fLoc[kTauScale]);
00522 
00523       pars->UE3Sqr() = ChooseValue(kUE3Sqr, coords);
00524 
00525       return pars;
00526     }
00527 
00528     case kDecoherence:{
00529       Decoherence* pars = new Decoherence;
00530 
00531       pars->Theta() = coords.at(fLoc[kTheta]);
00532       pars->Mu() = coords.at(fLoc[kMu]);
00533 
00534       return pars;
00535     }
00536 
00537     } // end switch
00538 
00539     assert(0 && "Unknown oscillation model");
00540   } // end try
00541 
00542   catch(std::out_of_range& e){
00543     MSG("NCCoordConv", Msg::kError) << "Out of range error in "
00544                                     << "OscParsForCoordNDim, with model "
00545                                     << fOscillationModel << " and coords size "
00546                                     << coords.size() << ". Aborting." << endl;
00547     abort();
00548   }
00549 }

NCParameter NC::CoordinateConverter::ParameterForFitParam ( NCType::EFitParam  par  )  const
NCParameter NC::CoordinateConverter::ParameterForFitterIndex ( int  idx  )  const

Definition at line 587 of file NCCoordinateConverter.cxx.

References fFitParams.

Referenced by AxesForParameter(), AxesForParameters(), NC::FitMaster::GetBestFitPointAsRegistry(), ParameterForFitParam(), and NC::FitMaster::Run().

00588 {
00589   assert(idx >= 0 && idx < int(fFitParams.size()));
00590 
00591   return fFitParams[idx];
00592 }

void NC::CoordinateConverter::Prepare ( const Registry r,
bool  hush = false 
)

Definition at line 347 of file NCCoordinateConverter.cxx.

References fFitParams, fFixedVals, fOscillationModel, fPrecScale, Registry::Get(), NCType::kDelta1, NCType::kDelta13, NCType::kDelta2, Msg::kInfo, NCType::kTheta13, NCType::kTheta14, NCType::kTheta23, NCType::kTheta24, NCType::kUE3Sqr, MSG, PrepareOscillations(), and PrepareSystematics().

Referenced by NC::FitMaster::Prepare(), and NCExtrapolation::Prepare().

00348 {
00349   int    tmpi;
00350   double tmpd;
00351 
00352   if(r.Get("DeltaCP3FlavorVal", tmpd)) fFixedVals[kDelta13]    = tmpd;
00353   if(r.Get("UE3SqrVal",         tmpd)) fFixedVals[kUE3Sqr]     = tmpd;
00354   if(r.Get("Theta13Val",        tmpd)) fFixedVals[kTheta13]    = tmpd;
00355   if(r.Get("Delta1Val",         tmpd)) fFixedVals[kDelta1]     = tmpd;
00356   if(r.Get("Delta2Val",         tmpd)) fFixedVals[kDelta2]     = tmpd;
00357   if(r.Get("Theta14Val",        tmpd)) fFixedVals[kTheta14]    = tmpd;
00358   if(r.Get("Theta24Val",        tmpd)) fFixedVals[kTheta24]    = tmpd;
00359   if(r.Get("Theta23Val",        tmpd)) fFixedVals[kTheta23]    = tmpd;
00360 
00361 
00362   if(r.Get("PrecScale",         tmpd)) fPrecScale         = tmpd;
00363 
00364   if(r.Get("OscillationModel",  tmpi)) fOscillationModel  = NCType::EOscModel(tmpi);
00365 
00366   PrepareOscillations(r);
00367   PrepareSystematics(r);
00368 
00369   if(!hush){
00370     MSG("NCCoordConv", Msg::kInfo) << "parameter names, labels, etc:" << endl;
00371 
00372     for(unsigned int i = 0; i < fFitParams.size(); ++i)
00373       MSG("NCCoordConv", Msg::kInfo) << fFitParams[i].ShortName() << "\t"
00374                                      << fFitParams[i].LatexName() << "\t"
00375                                      << fFitParams[i].Min() << " to "
00376                                      << fFitParams[i].Max() << " in "
00377                                      << fFitParams[i].Precision() << " with "
00378                                      << (fFitParams[i].UseLimits() ?
00379                                          "binding" : "non-binding")
00380                                      << " limits" << endl;
00381   }
00382 }

void NC::CoordinateConverter::PrepareOscillations ( const Registry r  )  [private]

Adds the systematics required for fOscillationModel to fFitParams.

Definition at line 167 of file NCCoordinateConverter.cxx.

References AddParameter(), MuELoss::e, fLoc, fOscillationModel, Registry::Get(), NCType::kAlpha, NCType::kDecay, NCType::kDecoherence, NCType::kDelta1, NCType::kDelta2, NCType::kDeltaMSqr, NCType::kDeltaMSqr31, NCType::kDeltaMSqr32, NCType::kDeltaMSqr41, NCType::kDeltaMSqr43, NCType::kFourFlavorDelta41Is0, NCType::kFourFlavorDelta43Is0, NCType::kFourFlavorDelta43IsBig, NCType::kFourFlavorGeneral, NCType::kFs, NCType::kMu, NCType::kNoOscillations, NCType::kSterileFraction, NCType::kSterileFractionTauNorm, NCType::kTauScale, kTheta, NCType::kTheta13, NCType::kTheta14, NCType::kTheta23, NCType::kTheta24, NCType::kTheta34, NCType::kThreeFlavor, NCType::kUE3Sqr, and NCType::kUMu3Sqr.

Referenced by Prepare().

00168 {
00169   const int    kNumUMu3SqrBins     = 100;
00170   const double kUMu3SqrStart       = 1e-3;
00171   const double kUMu3SqrEnd         = 1;
00172   const double kDeltaUMu3Sqr       = (kUMu3SqrEnd-kUMu3SqrStart)/kNumUMu3SqrBins;
00173 
00174   const int    kNumDeltaMSqrBins   = 300;
00175   const double kDeltaMSqrStart     = 1.5;
00176   const double kDeltaMSqrEnd       = 4.5;
00177   const double kDeltaDeltaMSqr     = (kDeltaMSqrEnd-kDeltaMSqrStart)/kNumDeltaMSqrBins;
00178 
00179   int tmpb;
00180 
00181   switch(fOscillationModel){
00182   case kThreeFlavor:
00183     fLoc[kDeltaMSqr32] = AddParameter("dmsq_32", "#Deltam^{2}_{32} (10^{-3} eV^{2})",
00184                                       kDeltaMSqrStart,
00185                                       kDeltaMSqrEnd,
00186                                       kDeltaDeltaMSqr, true);
00187 
00188     if(r.Get("FitUE3Sqr", tmpb) && tmpb){
00189       fLoc[kTheta13] = AddParameter("theta13", "#theta_{13}",
00190                                     0, TMath::Pi()*2, -1, true);
00191     }
00192 
00193     if(r.Get("FitTheta23", tmpb) && tmpb){
00194       fLoc[kTheta23] = AddParameter("theta23", "#theta_{23}",
00195                                     0, TMath::Pi()*2, -1, true);
00196     }
00197 
00198     return;
00199 
00200   case kNoOscillations:
00201     return;
00202 
00203   case kFourFlavorGeneral:
00204   case kFourFlavorDelta43IsBig:
00205   case kFourFlavorDelta43Is0:
00206   case kFourFlavorDelta41Is0:
00207 
00208     if(r.Get("FitTheta13", tmpb) && tmpb){
00209       fLoc[kTheta13] = AddParameter("theta13", "#theta_{13}",
00210                                     0, TMath::Pi()*2, -1, true);
00211     }
00212 
00213     if(r.Get("FitTheta23", tmpb) && tmpb){
00214       fLoc[kTheta23] = AddParameter("theta23", "#theta_{23}",
00215                                     0, TMath::Pi()/2, -1, true);
00216     }
00217 
00218     if(fOscillationModel != kFourFlavorDelta41Is0){
00219 
00220       if(r.Get("FitTheta14", tmpb) && tmpb){
00221         fLoc[kTheta14] = AddParameter("theta14", "#theta_{14}",
00222                                       0, TMath::Pi()*2, -1, true);
00223       }
00224 
00225       if(r.Get("FitTheta24", tmpb) && tmpb){
00226         fLoc[kTheta24] = AddParameter("theta24", "#theta_{24}",
00227                                       0, TMath::Pi()/3, -1, true);
00228       }
00229 
00230       if(r.Get("FitDelta1", tmpb) && tmpb){
00231         fLoc[kDelta1] = AddParameter("delta1", "#delta_{1}",
00232                                      0, TMath::Pi()*2, -1, true);
00233       }
00234 
00235       if(fOscillationModel != kFourFlavorDelta43Is0){
00236         if(r.Get("FitDelta2", tmpb) && tmpb){
00237           fLoc[kDelta2] = AddParameter("delta2", "#delta_{2}",
00238                                        0, TMath::Pi()*2, -1, true);
00239         }
00240       }
00241     } // end if not Delta41=0
00242 
00243     if(fOscillationModel != kFourFlavorDelta43Is0){
00244       fLoc[kTheta34] = AddParameter("theta34", "#theta_{34}",
00245                                     0, TMath::Pi()/3, -1, true);
00246     }
00247 
00248 
00249     // TODO - How big should the ranges on all these mass scales be?
00250     fLoc[kDeltaMSqr31] = AddParameter("dmsq_31", "#Deltam^{2}_{31} (10^{-3} eV^{2})",
00251                                       kDeltaMSqrStart,
00252                                       kDeltaMSqrEnd,
00253                                       kDeltaDeltaMSqr, true);
00254 
00255     if(fOscillationModel != kFourFlavorDelta43IsBig &&
00256        fOscillationModel != kFourFlavorDelta43Is0 &&
00257        fOscillationModel != kFourFlavorDelta41Is0){
00258 
00259       fLoc[kDeltaMSqr41] = AddParameter("dmsq_41", "#Deltam^{2}_{41} (10^{-3} eV^{2})",
00260                                         kDeltaMSqrStart,
00261                                         kDeltaMSqrEnd,
00262                                         kDeltaDeltaMSqr, true);
00263 
00264       fLoc[kDeltaMSqr43] = AddParameter("dmsq_43", "#Deltam^{2}_{43} (10^{-3} eV^{2})",
00265                                         kDeltaMSqrStart,
00266                                         kDeltaMSqrEnd,
00267                                         kDeltaDeltaMSqr, true);
00268     }
00269 
00270     return;
00271 
00272   case kSterileFraction:
00273     fLoc[kFs] = AddParameter("fs", "f_{s}", 0, 1, -1, true);
00274 
00275     fLoc[kUMu3Sqr] = AddParameter("umu3", "|U_{#mu3}|^{2}",
00276                                   kUMu3SqrStart,
00277                                   kUMu3SqrEnd,
00278                                   kDeltaUMu3Sqr, true);
00279 
00280     fLoc[kDeltaMSqr32] = AddParameter("dmsq",
00281                                       "#Deltam^{2}_{32} (10^{-3} eV^{2})",
00282                                       kDeltaMSqrStart,
00283                                       kDeltaMSqrEnd,
00284                                       kDeltaDeltaMSqr, true);
00285 
00286     if(r.Get("FitUE3Sqr", tmpb) && tmpb){
00287       fLoc[kUE3Sqr] = AddParameter("ue3", "|U_{e3}|^{2}", 0, 1, -1, true);
00288     }
00289 
00290     return;
00291 
00292   case kSterileFractionTauNorm:
00293     //fLoc[kFs] = AddParameter("fs", "f_{s}", 0, 1, -1, true);
00294 
00295     fLoc[kUMu3Sqr] = AddParameter("umu3", "|U_{#mu3}|^{2}",
00296                                   kUMu3SqrStart,
00297                                   kUMu3SqrEnd,
00298                                   kDeltaUMu3Sqr, true);
00299     fLoc[kTauScale] = AddParameter("tauscale", "A_{#tau}",
00300                                   -0.1,
00301                                   2,
00302                                   0.01, true);
00303     fLoc[kDeltaMSqr32] = AddParameter("dmsq",
00304                                       "#Deltam^{2}_{32} (10^{-3} eV^{2})",
00305                                       kDeltaMSqrStart,
00306                                       kDeltaMSqrEnd,
00307                                       kDeltaDeltaMSqr, true);
00308 
00309     if(r.Get("FitUE3Sqr", tmpb) && tmpb){
00310       fLoc[kUE3Sqr] = AddParameter("ue3", "|U_{e3}|^{2}", 0, 1, -1, true);
00311     }
00312     return;
00313 
00314   case kDecay:
00315     fLoc[kTheta] = AddParameter("theta", "#theta", 0, TMath::Pi()/2, -1, true);
00316 
00317     fLoc[kAlpha] = AddParameter("alpha", "#alpha (GeV/km)", 0, 8e-3, -1, true);
00318 
00319     // Using a lower limit of zero gets us the pure-decay dchisq
00320     fLoc[kDeltaMSqr] = AddParameter("dmsq_32", "#Deltam^{2} (10^{-3} eV^{2})",0, 4.5, -1, true);
00321 
00322     return;
00323 
00324   case kDecoherence:
00325     fLoc[kTheta] = AddParameter("theta", "#theta", 0, TMath::Pi()/2, -1, true);
00326 
00327     // TODO - range?
00328     fLoc[kMu] = AddParameter("mu", "#mu", 0, 0.2, -1, true);
00329 
00330     return;
00331   }
00332 
00333   assert(0 && "Unknown oscillation model");
00334 }

void NC::CoordinateConverter::PrepareSystematics ( const Registry r  )  [private]
NC::SystPars NC::CoordinateConverter::SystParsFromCoordNDim ( const Fitter::CoordNDim coord  )  const

Translates between fitter's coordinates and systematic parameters.

Definition at line 386 of file NCCoordinateConverter.cxx.

References fLoc, NC::SystPars::fShifts, IsFit(), IsSystematic(), NCType::kNumParameters, and n.

Referenced by NC::GetChiSqrFromDerived::EvalAtEx(), NCExtrapolation::GetBestFitSysts(), NCExtrapolation::SetBestFitCoordNDim(), and NC::FitMaster::SetBestFitCoordNDim().

00387 {
00388   NC::SystPars ret;
00389 
00390   for(int n = 0; n < kNumParameters; ++n){
00391     if(!IsSystematic(EFitParam(n))) continue;
00392 
00393     if(IsFit(EFitParam(n))) ret.fShifts[n] = coords[fLoc[n]];
00394   }
00395 
00396   return ret;
00397 }

void NC::CoordinateConverter::TryAddSystematic ( const Registry r,
NCType::EFitParam  p 
) [private]

Add systematic p to fFitParams if r thinks we should.

Definition at line 145 of file NCCoordinateConverter.cxx.

References AddSystematicParameter(), fLoc, Registry::Get(), NCType::kParams, and NCType::ParamDef::name.

Referenced by PrepareSystematics().

00147 {
00148   int tmpb;
00149   TString key = "Fit"+NCType::kParams[p].name;
00150   if(r.Get(key, tmpb) && tmpb) fLoc[p] = AddSystematicParameter(p);
00151 }

vector< double > NC::CoordinateConverter::VectorFromSystPars ( const NC::SystPars s  )  const

Definition at line 730 of file NCCoordinateConverter.cxx.

References NC::SystPars::fShifts, IsFit(), IsSystematic(), NCType::kNumParameters, NCType::kParams, n, and NCType::ParamDef::sigma.

Referenced by NCExtrapolationBeamMatrix::WriteResources().

00731 {
00732   vector<double> shift;
00733 
00734   for(int n = 0; n < kNumParameters; ++n){
00735     if(!IsSystematic(EFitParam(n))) continue;
00736 
00737     if(IsFit(EFitParam(n))) shift.push_back(s.fShifts[n]/kParams[n].sigma);
00738   }
00739 
00740   return shift;
00741 }


Member Data Documentation

List of details of parameters used in the fit.

in the same order as fitter coordinates.

Definition at line 165 of file NCCoordinateConverter.h.

Referenced by NC::FitMaster::MargWithFixedVals(), ParameterForFitterIndex(), Prepare(), and NC::FitMaster::Run().

double NC::CoordinateConverter::fFixedVals[NCType::kNumParameters] [private]

Mapping from EFitParam constants to fixed value, if the parameter is not fit.

Defaults to -9999

Definition at line 154 of file NCCoordinateConverter.h.

Referenced by ChooseValue(), CoordinateConverter(), OscParsFromCoordNDim(), and Prepare().

int NC::CoordinateConverter::fLoc[NCType::kNumParameters] [private]

Mapping from EFitParam constants to fitter coordinate indices.

-1 means the parameter isn't used in the fit

Definition at line 148 of file NCCoordinateConverter.h.

Referenced by ChooseValue(), CoordinateConverter(), FitterIndex(), IsFit(), OscParsFromCoordNDim(), PrepareOscillations(), SystParsFromCoordNDim(), and TryAddSystematic().

Definition at line 158 of file NCCoordinateConverter.h.

Referenced by Prepare().


The documentation for this class was generated from the following files:

Generated on 3 Oct 2018 for loon by  doxygen 1.6.1