#include <NuFCConfig.h>
Public Member Functions | |
| void | PrintStatus () |
| Prints out the configuration status. | |
| void | LoadConfig (std::string filename) |
| Loads a configuration file. | |
| std::string | GetHelperFileName () |
| Saves the configuration to a file. | |
| std::string | GetNDMC () |
| bool | Systematics () |
| std::string | GetEventsND () |
| std::string | GetEventsFD () |
| std::string | GetEventsTau () |
| double | POT () |
| bool | Archive () |
| bool | FixedSin () |
| bool | FixedDm2 () |
Static Public Member Functions | |
| static NuFCConfig & | GetConfig () |
| Retrieves the instance of NuFCConfig. | |
Private Member Functions | |
| NuFCConfig () | |
| NuFCConfig (NuFCConfig &config) | |
| NuFCConfig & | operator= (NuFCConfig &) |
| std::string | GridCache (std::string filename) |
Private Attributes | |
| std::string | fHelperFile |
| std::string | fNDMC |
| bool | fFCSystematics |
| std::string | fFCevents_Near |
| std::string | fFCevents_Far |
| std::string | fFCevents_Tau |
| double | fPOT |
| bool | fFixedMixingAngle |
| bool | fFixedMassSplitting |
| bool | fArchive |
Static Private Attributes | |
| static NuFCConfig | fInstance |
Definition at line 11 of file NuFCConfig.h.
| NuFCConfig::NuFCConfig | ( | ) | [private] |
Definition at line 25 of file NuFCConfig.cxx.
References fArchive, fFCevents_Far, fFCevents_Near, fFCevents_Tau, fFCSystematics, fFixedMassSplitting, fFixedMixingAngle, fHelperFile, fNDMC, and fPOT.
00026 { 00027 // Initialise everything with defaults 00028 00029 fHelperFile = "CombinedHelpersRun1LE_bravo.root"; 00030 fNDMC = "NDMCRun1LE_bravo.root"; 00031 00032 // FC Systematics variables 00033 fFCSystematics = true; 00034 fFCevents_Near = "/minos/data/analysis/NuMuBar/Helpers/Bravo/near_events.root"; 00035 fFCevents_Far = "/minos/data/analysis/NuMuBar/Helpers/Bravo/far_events.root"; 00036 fFCevents_Tau = "/minos/data/analysis/NuMuBar/Helpers/Bravo/tau_events.root"; 00037 00038 fPOT = 3.2e20; 00039 00040 fArchive = false; 00041 fFixedMixingAngle = false; 00042 fFixedMassSplitting = false; 00043 }
| NuFCConfig::NuFCConfig | ( | NuFCConfig & | config | ) | [private] |
| bool NuFCConfig::Archive | ( | ) | [inline] |
| bool NuFCConfig::FixedDm2 | ( | ) | [inline] |
Definition at line 38 of file NuFCConfig.h.
References fFixedMassSplitting.
Referenced by NuFCFitterNSINubar::CoarseGridSearch(), NuFCFitterNSINu::CoarseGridSearch(), NuFCFitterNSINubar::FineGridSearch(), NuFCFitterNSINu::FineGridSearch(), NuFCFitterNSINubar::GridSearch(), NuFCFitterNSINu::GridSearch(), NuFCFitterNSINubar::MinuitFit(), NuFCFitterNSINu::MinuitFit(), NuFCGridPointNSINu::NuFCGridPointNSINu(), NuFCGridPointNSINubar::NuFCGridPointNSINubar(), NuFCFitterNSINubar::RecoverNegativeDeltaChi(), and NuFCFitterNSINu::RecoverNegativeDeltaChi().
00038 { return fFixedMassSplitting; }
| bool NuFCConfig::FixedSin | ( | ) | [inline] |
Definition at line 37 of file NuFCConfig.h.
References fFixedMixingAngle.
Referenced by NuFCFitterNSI::CoarseGridSearch(), NuFCFitter::CoarseGridSearch(), NuFCFitterNSI::FineGridSearch(), NuFCFitter::FineGridSearch(), NuFCFitterNSI::GridSearch(), NuFCFitter::GridSearch(), NuFCFitterNSI::MinuitFit(), NuFCFitter::MinuitFit(), NuFCGridPoint::NuFCGridPoint(), NuFCFitterNSI::RecoverNegativeDeltaChi(), and NuFCFitter::RecoverNegativeDeltaChi().
00037 { return fFixedMixingAngle; }
| NuFCConfig & NuFCConfig::GetConfig | ( | ) | [static] |
Retrieves the instance of NuFCConfig.
Definition at line 79 of file NuFCConfig.cxx.
References fInstance.
Referenced by NuFCFitterNSINubar::CoarseGridSearch(), NuFCFitterNSINu::CoarseGridSearch(), NuFCFitterNSI::CoarseGridSearch(), NuFCFitter::CoarseGridSearch(), NuFCFitterNSINubar::FineGridSearch(), NuFCFitterNSINu::FineGridSearch(), NuFCFitterNSI::FineGridSearch(), NuFCFitter::FineGridSearch(), NuFCFitterNSINubar::GridSearch(), NuFCFitterNSINu::GridSearch(), NuFCFitterNSI::GridSearch(), NuFCFitter::GridSearch(), NuFCFitterNSINubar::MinuitFit(), NuFCFitterNSINu::MinuitFit(), NuFCFitterNSI::MinuitFit(), NuFCFitter::MinuitFit(), NuFCGridPoint::NuFCGridPoint(), NuFCGridPointNSINu::NuFCGridPointNSINu(), NuFCGridPointNSINubar::NuFCGridPointNSINubar(), NuFCFitterNSINubar::RecoverNegativeDeltaChi(), NuFCFitterNSINu::RecoverNegativeDeltaChi(), NuFCFitterNSI::RecoverNegativeDeltaChi(), and NuFCFitter::RecoverNegativeDeltaChi().
00080 { 00081 // if (fInstance == 0) { 00082 // // We need to create a configuration 00083 // fInstance = new NuFCConfig; 00084 // } 00085 // return fInstance; 00086 00087 return fInstance; 00088 }
| std::string NuFCConfig::GetEventsFD | ( | ) |
Definition at line 146 of file NuFCConfig.cxx.
References fFCevents_Far, and GridCache().
Referenced by NuFCGridPoint::NuFCGridPoint(), NuFCGridPointNSINu::NuFCGridPointNSINu(), and NuFCGridPointNSINubar::NuFCGridPointNSINubar().
00147 { 00148 static bool firstRun = true; 00149 if (firstRun) { 00150 fFCevents_Far = GridCache(fFCevents_Far); 00151 firstRun = false; 00152 } 00153 return fFCevents_Far; 00154 }
| std::string NuFCConfig::GetEventsND | ( | ) |
Definition at line 136 of file NuFCConfig.cxx.
References fFCevents_Near, and GridCache().
Referenced by NuFCGridPoint::NuFCGridPoint(), NuFCGridPointNSINu::NuFCGridPointNSINu(), and NuFCGridPointNSINubar::NuFCGridPointNSINubar().
00137 { 00138 static bool firstRun = true; 00139 if (firstRun) { 00140 fFCevents_Near = GridCache(fFCevents_Near); 00141 firstRun = false; 00142 } 00143 return fFCevents_Near; 00144 }
| std::string NuFCConfig::GetEventsTau | ( | ) |
Definition at line 156 of file NuFCConfig.cxx.
References fFCevents_Tau, and GridCache().
Referenced by NuFCGridPoint::NuFCGridPoint(), NuFCGridPointNSINu::NuFCGridPointNSINu(), and NuFCGridPointNSINubar::NuFCGridPointNSINubar().
00157 { 00158 static bool firstRun = true; 00159 if (firstRun) { 00160 fFCevents_Tau = GridCache(fFCevents_Tau); 00161 firstRun = false; 00162 } 00163 return fFCevents_Tau; 00164 }
| std::string NuFCConfig::GetHelperFileName | ( | ) |
Saves the configuration to a file.
Definition at line 116 of file NuFCConfig.cxx.
References fHelperFile, and GridCache().
00117 { 00118 static bool firstRun = true; 00119 if (firstRun) { 00120 fHelperFile = GridCache(fHelperFile); 00121 firstRun = false; 00122 } 00123 return fHelperFile; 00124 }
| std::string NuFCConfig::GetNDMC | ( | ) |
Definition at line 126 of file NuFCConfig.cxx.
References fNDMC, and GridCache().
00127 { 00128 static bool firstRun = true; 00129 if (firstRun) { 00130 fNDMC = GridCache(fNDMC); 00131 firstRun = false; 00132 } 00133 return fNDMC; 00134 }
| std::string NuFCConfig::GridCache | ( | std::string | filename | ) | [private] |
Definition at line 170 of file NuFCConfig.cxx.
Referenced by GetEventsFD(), GetEventsND(), GetEventsTau(), GetHelperFileName(), and GetNDMC().
00171 { 00172 const char * sd = getenv("_CONDOR_SCRATCH_DIR"); 00173 if (sd == NULL) { 00174 // We're not on the grid 00175 // Don't cache -- return input filename 00176 cout << "Not caching " << filename << endl; 00177 return filename; 00178 } 00179 std::string scratchdir = sd; 00180 if (scratchdir[scratchdir.size()-1] != '/') 00181 scratchdir += "/"; 00182 00183 00184 00185 size_t found = filename.find_last_of('/'); 00186 //std::string dir = filename.substr(0,found); 00187 std::string file = filename.substr(found+1); 00188 std::string retfile = scratchdir; 00189 retfile += file; 00190 00191 cout << "Using cahced " << retfile << " for " << filename << endl; 00192 00193 /* 00194 std::string cmd = getenv("CPN"); 00195 cmd += " "; 00196 cmd += filename; 00197 cmd += " "; 00198 cmd += scratchdir; 00199 cout << "cmd: " << cmd << endl; 00200 int errv = system(cmd.c_str()); 00201 if (errv != 0) { 00202 cout << cmd << " returned " << errv << ". There may be a problem." << endl; 00203 } 00204 std::string lscmd = "ls "; 00205 lscmd += scratchdir; 00206 system(lscmd.c_str()); 00207 */ 00208 return retfile; 00209 }
| void NuFCConfig::LoadConfig | ( | std::string | filename | ) |
Loads a configuration file.
Definition at line 90 of file NuFCConfig.cxx.
References fArchive, fFCevents_Far, fFCevents_Near, fFCevents_Tau, fFCSystematics, fFixedMassSplitting, fFixedMixingAngle, fHelperFile, fNDMC, fPOT, ConfigFile::GetBool(), ConfigFile::GetFloat(), and ConfigFile::GetString().
00091 { 00092 ConfigFile cfg(filename); 00093 00094 // Load all the variables out of it 00095 00096 // Generation sources 00097 fHelperFile = cfg.GetString("Helper", "MC", fHelperFile); 00098 fNDMC = cfg.GetString("Neardet", "MC", fNDMC); 00099 00100 // Systematics variables 00101 fFCSystematics = cfg.GetBool("Systematics", "FC_Systematics", fFCSystematics); 00102 fArchive = cfg.GetBool("Archive", "Generation", fArchive); 00103 fFCevents_Near = cfg.GetString("Near_Events", "FC_Systematics", fFCevents_Near); 00104 fFCevents_Far = cfg.GetString("Far_Events", "FC_Systematics", fFCevents_Far); 00105 fFCevents_Tau = cfg.GetString("Tau_Events", "FC_Systematics", fFCevents_Tau); 00106 00107 fPOT = cfg.GetFloat("POT", "Generation", fPOT); 00108 00109 // Fitting variables 00110 fFixedMixingAngle = cfg.GetBool("OneParameter", "Fitting", fFixedMixingAngle); 00111 fFixedMassSplitting = cfg.GetBool("OneParameterNSI", "Fitting", fFixedMassSplitting); 00112 }
| NuFCConfig& NuFCConfig::operator= | ( | NuFCConfig & | ) | [private] |
| double NuFCConfig::POT | ( | ) | [inline] |
| void NuFCConfig::PrintStatus | ( | ) |
Prints out the configuration status.
Definition at line 45 of file NuFCConfig.cxx.
References fArchive, fFCevents_Far, fFCevents_Near, fFCevents_Tau, fFCSystematics, fFixedMassSplitting, fFixedMixingAngle, fHelperFile, fNDMC, and fPOT.
00046 { 00047 // Make a nicified string for the systematics status 00048 string syststatus = "No"; 00049 if (fFCSystematics) syststatus = "Yes"; 00050 00051 string archstatus = "No"; 00052 if (fArchive) archstatus = "Yes"; 00053 00054 string fixedsin = "No"; 00055 if (fFixedMixingAngle) fixedsin = "Yes"; 00056 00057 string fixeddm2 = "No"; 00058 if(fFixedMassSplitting) fixeddm2 = "Yes"; 00059 00060 cout << "***************************************************" << endl; 00061 cout << "Configuration:" << endl 00062 << "POT: " << fPOT << endl 00063 << "Helper File: " << fHelperFile << endl 00064 << "ND MC: " << fNDMC << endl 00065 << "Systematics? " << syststatus << endl 00066 << "Archive? " << archstatus << endl 00067 << "Fixed Sin? " << fixedsin << endl 00068 << "FixedDm2? " << fixeddm2 << endl; 00069 00070 // Only show the systematics only vars if we want systematics 00071 cout << "FC Events" << endl 00072 << "Near Events: " << fFCevents_Near << endl 00073 << "Far Events: " << fFCevents_Far << endl 00074 << "Tau Events: " << fFCevents_Tau << endl; 00075 cout << "***************************************************" << endl; 00076 }
| bool NuFCConfig::Systematics | ( | ) | [inline] |
Definition at line 29 of file NuFCConfig.h.
References fFCSystematics.
Referenced by NuFCGridPoint::NuFCGridPoint(), NuFCGridPointNSINu::NuFCGridPointNSINu(), and NuFCGridPointNSINubar::NuFCGridPointNSINubar().
00029 { return fFCSystematics; }
bool NuFCConfig::fArchive [private] |
Definition at line 68 of file NuFCConfig.h.
Referenced by Archive(), LoadConfig(), NuFCConfig(), and PrintStatus().
std::string NuFCConfig::fFCevents_Far [private] |
Definition at line 59 of file NuFCConfig.h.
Referenced by GetEventsFD(), LoadConfig(), NuFCConfig(), and PrintStatus().
std::string NuFCConfig::fFCevents_Near [private] |
Definition at line 58 of file NuFCConfig.h.
Referenced by GetEventsND(), LoadConfig(), NuFCConfig(), and PrintStatus().
std::string NuFCConfig::fFCevents_Tau [private] |
Definition at line 60 of file NuFCConfig.h.
Referenced by GetEventsTau(), LoadConfig(), NuFCConfig(), and PrintStatus().
bool NuFCConfig::fFCSystematics [private] |
Definition at line 57 of file NuFCConfig.h.
Referenced by LoadConfig(), NuFCConfig(), PrintStatus(), and Systematics().
bool NuFCConfig::fFixedMassSplitting [private] |
Definition at line 66 of file NuFCConfig.h.
Referenced by FixedDm2(), LoadConfig(), NuFCConfig(), and PrintStatus().
bool NuFCConfig::fFixedMixingAngle [private] |
Definition at line 65 of file NuFCConfig.h.
Referenced by FixedSin(), LoadConfig(), NuFCConfig(), and PrintStatus().
std::string NuFCConfig::fHelperFile [private] |
Definition at line 53 of file NuFCConfig.h.
Referenced by GetHelperFileName(), LoadConfig(), NuFCConfig(), and PrintStatus().
NuFCConfig NuFCConfig::fInstance [static, private] |
std::string NuFCConfig::fNDMC [private] |
Definition at line 54 of file NuFCConfig.h.
Referenced by GetNDMC(), LoadConfig(), NuFCConfig(), and PrintStatus().
double NuFCConfig::fPOT [private] |
Definition at line 62 of file NuFCConfig.h.
Referenced by LoadConfig(), NuFCConfig(), POT(), and PrintStatus().
1.4.7