#include <NueSenseConfig.h>
Public Types | |
| enum | SenseMethod { kAllNumbers = 1, kNueHist = 2, kAnaNueFiles = 3, kNumbers = 4 } |
Public Member Functions | |
| NueSenseConfig () | |
| NueSenseConfig (std::string input) | |
| void | ReadInput (std::string input) |
| bool | CheckConfig () |
| void | Reset () |
| double | GetPOT () |
| int | GetDataMethod () |
| bool | ShouldDeOsc () |
| float | GetOldUe3Square () |
| float | GetOldDeltaMSquare () |
| float | GetNumber (int i) |
| std::string | GetNueHistFile () |
| std::string | GetNueHistName () |
| int | GetNumFiles () |
| std::string | GetFile (int i) |
| NSCDataParam | GetDeltaMS23 () |
| NSCDataParam | GetDelta () |
| NSCDataParam | GetSinS2Th13 () |
| float | GetDeltaMS12 () |
| float | GetSinS2Th12 () |
| float | GetSinS2Th23 () |
| float | GetDensity () |
| int | GetNumberConfig () |
| NSCErrorParam | GetErrorConfig (int i) |
| std::vector< std::string > | GetDataFiles () |
Private Member Functions | |
| void | SetDataInfo (int nuClass, std::string line) |
| void | SetParamInfo (NSCDataParam &par, std::string line) |
Private Attributes | |
| int | fDataMethod |
| double | fPOT |
| bool | found [5] |
| std::string | signuehfile |
| std::string | signuehname |
| float | fOscUe3Square |
| float | fOscDeltaMS23 |
| bool | fMustDeOsc |
| NSCDataParam | DeltaMS23 |
| NSCDataParam | Delta |
| NSCDataParam | SinS2Th13 |
| float | DeltaMS12 |
| float | SinS2Th12 |
| float | SinS2Th23 |
| float | density |
| float | number [5] |
| std::vector< std::string > | datafiles |
| std::vector< NSCErrorParam > | errorsets |
|
|
Definition at line 63 of file NueSenseConfig.h. 00063 {
00064 kAllNumbers = 1,
00065 kNueHist = 2,
00066 kAnaNueFiles =3,
00067 kNumbers = 4
00068 };
|
|
|
Definition at line 16 of file NueSenseConfig.cxx. References Reset(). 00016 {
00017 Reset();
00018 }
|
|
|
Definition at line 20 of file NueSenseConfig.cxx. References ReadInput(), and Reset().
|
|
|
Definition at line 252 of file NueSenseConfig.cxx. References datafiles, Delta, DeltaMS12, DeltaMS23, NSCDataParam::end, errorsets, fDataMethod, fMustDeOsc, fOscDeltaMS23, fOscUe3Square, found, fPOT, NSCDataParam::isfixed, number, signuehfile, signuehname, SinS2Th12, SinS2Th13, SinS2Th23, and NSCDataParam::start. Referenced by ReadInput(), NueSensitivity::Run(), and NueFCSensitivity::Run(). 00252 {
00253
00254 if(fDataMethod < 1 || fDataMethod > 4) return false;
00255 if(fDataMethod == 1 || fDataMethod == 2){
00256 for(int i = 0; i < 5; i++) { if(!found[i]) return false; }
00257 }
00258 if(fDataMethod == 1 || fDataMethod == 2){
00259 if(fPOT < 0) return false;
00260 if(number[0] < 0) return false;
00261 if(number[1] < 0) return false;
00262 if(number[3] < 0) return false;
00263 if(number[4] < 0) return false;
00264 if(fMustDeOsc && (fOscUe3Square < 0 || fOscDeltaMS23 < 0))
00265 return false;
00266 }
00267 if(fDataMethod == 1){
00268 if(!fMustDeOsc) return false; //Can't just have a number without some oscillation
00269 if(number[2] < 0) return false;
00270 DeltaMS23.start = 2.7; DeltaMS23.isfixed = true;
00271 Delta.start = 0.0; Delta.isfixed = true;
00272 }
00273
00274 if(fDataMethod == 2 && (signuehfile.size() == 0 || signuehname.size() == 0))
00275 return false;
00276
00277 if(fDataMethod == 3 && datafiles.size() == 0) return false;
00278 if(fDataMethod == 4 && datafiles.size() == 0) return false;
00279
00280 if(DeltaMS12 < 0) return false;
00281 if(SinS2Th12 < 0) return false;
00282 if(SinS2Th23 < 0) return false;
00283 if(!DeltaMS23.isfixed && DeltaMS23.start > DeltaMS23.end) return false;
00284 if(!Delta.isfixed && Delta.start > Delta.end) return false;
00285 if(!SinS2Th13.isfixed && SinS2Th13.start > SinS2Th13.end) return false;
00286
00287 if(DeltaMS23.isfixed) { DeltaMS23.end = DeltaMS23.start; }
00288 if(Delta.isfixed) { Delta.end = Delta.start; }
00289 if(SinS2Th13.isfixed) { SinS2Th13.end = SinS2Th13.start; }
00290
00291 if(errorsets.size() == 0){
00292 NSCErrorParam set;
00293 errorsets.push_back(set);
00294 }
00295
00296 return true;
00297 }
|
|
|
Definition at line 106 of file NueSenseConfig.h. Referenced by NueSensitivity::SetupGridRun(), and NueFCSensitivity::SetupGridRun(). 00106 { return datafiles;};
|
|
|
Definition at line 80 of file NueSenseConfig.h. Referenced by NueSensitivity::Run(), and NueFCSensitivity::Run(). 00080 {return fDataMethod;}
|
|
|
Definition at line 94 of file NueSenseConfig.h. Referenced by NueSensitivity::ProduceTree(), NueFCSensitivity::ProduceTree(), NueSensitivity::RunStandardApproach(), and NueFCSensitivity::RunStandardApproach(). 00094 { return Delta;}
|
|
|
Definition at line 97 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), NueFCSensitivity::Initialize(), NueSensitivity::ProduceTree(), and NueFCSensitivity::ProduceTree(). 00097 { return DeltaMS12;}; //units of 1e-5 eV^2
|
|
|
Definition at line 93 of file NueSenseConfig.h. Referenced by NueSensitivity::ProduceTree(), NueFCSensitivity::ProduceTree(), NueSensitivity::RunStandardApproach(), and NueFCSensitivity::RunStandardApproach(). 00093 { return DeltaMS23;}
|
|
|
Definition at line 100 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), and NueFCSensitivity::Initialize(). 00100 { return density; };
|
|
|
Definition at line 104 of file NueSenseConfig.h. Referenced by NueSensitivity::CalculateChi2(), NueFCSensitivity::CalculateChi2(), NueSensitivity::CalculateFitChi2(), NueFCSensitivity::CalculateFitChi2(), NueFCSensitivity::EvaluateOmega(), NueSensitivity::GetPoint(), NueFCSensitivity::GetPoint(), NueSensitivity::ProduceTree(), NueFCSensitivity::ProduceTree(), and NueFCSensitivity::SetupGridRun(). 00104 { return errorsets[i]; };
|
|
|
Definition at line 90 of file NueSenseConfig.h. Referenced by NueSensitivity::LoadEventsFromFile(), and NueFCSensitivity::LoadEventsFromFile(). 00090 {return datafiles[i];};
|
|
|
Definition at line 87 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), and NueFCSensitivity::Initialize(). 00087 { return signuehfile; }
|
|
|
Definition at line 88 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), and NueFCSensitivity::Initialize(). 00088 { return signuehname; }
|
|
|
Definition at line 86 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), and NueFCSensitivity::Initialize(). 00086 {return number[i];};
|
|
|
Definition at line 103 of file NueSenseConfig.h. Referenced by NueSensitivity::ProduceTree(), NueFCSensitivity::ProduceTree(), NueSensitivity::Run(), and NueFCSensitivity::Run(). 00103 {return errorsets.size(); }
|
|
|
Definition at line 89 of file NueSenseConfig.h. Referenced by NueSensitivity::LoadEventsFromFile(), and NueFCSensitivity::LoadEventsFromFile(). 00089 {return datafiles.size(); } ;
|
|
|
Definition at line 84 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), and NueFCSensitivity::Initialize(). 00084 { return fOscDeltaMS23; }
|
|
|
Definition at line 83 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), and NueFCSensitivity::Initialize(). 00083 { return fOscUe3Square;}
|
|
|
Definition at line 77 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), NueFCSensitivity::Initialize(), NueSensitivity::SetupGridRun(), and NueFCSensitivity::SetupGridRun(). 00077 {return fPOT;}
|
|
|
Definition at line 98 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), NueFCSensitivity::Initialize(), NueSensitivity::ProduceTree(), and NueFCSensitivity::ProduceTree(). 00098 { return SinS2Th12;}; //Sin^2(2Theta12)
|
|
|
Definition at line 95 of file NueSenseConfig.h. Referenced by NueSensitivity::ProduceTree(), NueFCSensitivity::ProduceTree(), NueSensitivity::RunStandardApproach(), and NueFCSensitivity::RunStandardApproach(). 00095 { return SinS2Th13;}
|
|
|
Definition at line 99 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), NueFCSensitivity::Initialize(), NueSensitivity::ProduceTree(), and NueFCSensitivity::ProduceTree(). 00099 { return SinS2Th23;}; //Sin^2(2Theta23)
|
|
|
Definition at line 54 of file NueSenseConfig.cxx. References NSCErrorParam::bg_systematic, CheckConfig(), datafiles, Delta, DeltaMS12, DeltaMS23, density, errorsets, fDataMethod, fMustDeOsc, fOscDeltaMS23, fOscUe3Square, fPOT, NSCErrorParam::scale, SetDataInfo(), SetParamInfo(), NSCErrorParam::sig_systematic, SinS2Th12, SinS2Th13, and SinS2Th23. Referenced by NueSenseConfig(). 00055 {
00056 std::ifstream stream;
00057 stream.open(input.c_str());
00058 assert(stream.is_open() && "Can't open input file");
00059 std::cout <<"Reading Nue Data from "<<input<<std::endl;
00060
00061 std::string line, temp;
00062 char cline[200];
00063
00064 while (stream.getline(cline,200)){
00065 line=cline;
00066 if (line.find("/",0)==0||line.size()==0) continue; //ignore comments
00067
00068
00069 if(line.find("BEGINDATA") != std::string::npos){
00070 while (line.substr(0,7) != "ENDDATA"){
00071 stream.getline(cline,200);
00072 line=cline;
00073 if (line.find("/",0)==0||line.size()==0) continue;
00074
00075 if (line.find("METHOD") != std::string::npos) {
00076 fDataMethod = atoi((line.substr(7,line.size()-7)).c_str());
00077 }
00078 if (line.find("POT") != std::string::npos) {
00079 fPOT = atof((line.substr(3,line.size()-3)).c_str());
00080 continue;
00081 }
00082 if (line.find("Numu")!=std::string::npos){
00083 SetDataInfo(ClassType::numu, line); continue;
00084 }
00085 if (line.find("NC")!=std::string::npos){
00086 SetDataInfo(ClassType::NC, line); continue;
00087 }
00088 if (line.find("BNue")!=std::string::npos){
00089 SetDataInfo(ClassType::bnue, line); continue;
00090 }
00091 if (line.find("Nutau")!=std::string::npos) {
00092 SetDataInfo(ClassType::nutau, line); continue;
00093 }
00094 if (line.find("SigNue")!=std::string::npos){
00095 SetDataInfo(ClassType::nue, line); continue;
00096 }
00097 if (line.find("NOOSC")!=std::string::npos){
00098 fOscUe3Square = fOscDeltaMS23 = -1;
00099 fMustDeOsc = false; continue;
00100 }
00101 if (line.find("OSCPAR")!=std::string::npos){
00102 temp = line.substr(line.find("{")+1,
00103 line.find_first_of(",")-line.find("{")-1);
00104 fOscUe3Square = atof(temp.c_str());
00105 temp = line.substr(line.find_last_of(",")+1,
00106 line.find("}")-line.find_last_of(",")-1);
00107 fOscDeltaMS23 = atof(temp.c_str());
00108 fMustDeOsc = true; continue;
00109 }
00110 if(line.find("FILE")!=std::string::npos){
00111 if(fDataMethod != 3 && fDataMethod != 4){
00112 std::cout<<"Error in config file, invalid data input"<<std::endl;
00113 continue;
00114 }
00115 temp = line.substr(line.find("{")+1,
00116 line.find_first_of("}")-line.find("{")-1);
00117 datafiles.push_back(temp);
00118 continue;
00119 }
00120 }
00121 } //End of Parsing the input data
00122
00123 if(line.find("BEGINPAR") != std::string::npos){
00124 while (line.substr(0,6) != "ENDPAR"){
00125 stream.getline(cline,200);
00126 line=cline;
00127 if (line.find("/",0)==0||line.size()==0) continue;
00128
00129 if (line.find("DELTAM2_23")!=std::string::npos) {
00130 SetParamInfo(DeltaMS23, line); continue;
00131 }
00132 if (line.find("SIN2(2TH13)")!=std::string::npos){
00133 SetParamInfo(SinS2Th13, line); continue;
00134 }
00135 if (line.find("DELTACP")!=std::string::npos) {
00136 SetParamInfo(Delta, line); continue;
00137 }
00138 if (line.find("DELTAM2_12")!=std::string::npos){
00139 DeltaMS12 = atof((line.substr(10,line.size()-10)).c_str());
00140 continue;
00141 }
00142 if (line.find("SIN2(2TH23)")!=std::string::npos) {
00143 SinS2Th23 = atof((line.substr(11,line.size()-11)).c_str());
00144 continue;
00145 }
00146 if (line.find("SIN2(2TH12)")!=std::string::npos) {
00147 SinS2Th12 = atof((line.substr(11,line.size()-11)).c_str());
00148 continue;
00149 }
00150 if (line.find("DENSITY")!=std::string::npos) {
00151 density = atof((line.substr(8,line.size()-7)).c_str());
00152 continue;
00153 }
00154
00155 } //End of while loop
00156 } //End of Par data
00157
00158 if(line.find("BEGINSET") != std::string::npos){
00159 NSCErrorParam set;
00160 while (line.substr(0,6) != "ENDSET"){
00161 stream.getline(cline,200);
00162 line=cline;
00163 if (line.find("/",0)==0||line.size()==0) continue; //ignore comments
00164
00165 if (line.find("BG_SYSTEMATIC") != std::string::npos) {
00166 set.bg_systematic = atof((line.substr(13,line.size()-13)).c_str());
00167 continue;
00168 }
00169 if (line.find("SIG_SYSTEMATIC") != std::string::npos) {
00170 set.sig_systematic = atof((line.substr(14,line.size()-14)).c_str());
00171 continue;
00172 }
00173 if (line.find("NCSCALE") != std::string::npos) {
00174 set.scale[ClassType::NC] = atof((line.substr(7,line.size()-7)).c_str());
00175 continue;
00176 }
00177 if (line.find("NUMUSCALE") != std::string::npos) {
00178 set.scale[ClassType::numu] = atof((line.substr(9,line.size()-9)).c_str());
00179 continue;
00180 }
00181 if (line.find("BNUESCALE") != std::string::npos) {
00182 set.scale[ClassType::bnue] = atof((line.substr(9,line.size()-9)).c_str());
00183 continue;
00184 }
00185 if (line.find("NUTAUSCALE") != std::string::npos) {
00186 set.scale[ClassType::nutau] = atof((line.substr(10,line.size()-10)).c_str());
00187 continue;
00188 }
00189 if (line.find("SIGNUESCALE") != std::string::npos) {
00190 set.scale[ClassType::nue] = atof((line.substr(12,line.size()-12)).c_str());
00191 continue;
00192 }
00193 }
00194 //create a name for the set?
00195 // put the details in a separate tree in each subdir the way chris would do things?
00196 errorsets.push_back(set);
00197 }
00198 }
00199 std::cout <<"Finished Reading Nue Data "<<std::endl;
00200
00201 CheckConfig();
00202 }
|
|
|
Definition at line 26 of file NueSenseConfig.cxx. References Delta, DeltaMS12, DeltaMS23, density, NSCDataParam::end, fDataMethod, fMustDeOsc, fOscDeltaMS23, fOscUe3Square, found, fPOT, NSCDataParam::isfixed, number, SinS2Th12, SinS2Th13, SinS2Th23, and NSCDataParam::start. Referenced by NueSensitivity::Initialize(), NueFCSensitivity::Initialize(), and NueSenseConfig(). 00027 {
00028 fDataMethod = 0;
00029 fPOT = 9.25;
00030 fOscUe3Square = -1.0;
00031 fOscDeltaMS23 = -1.0;
00032 fMustDeOsc = false;
00033 DeltaMS12 = 8.7;
00034 SinS2Th12 = 0.816;
00035 SinS2Th23 = 1.0;
00036
00037 for(int i = 0; i < 5; i++){
00038 number[i] = 0.0;
00039 found[i] = true;
00040 }
00041
00042 DeltaMS23.isfixed = true;
00043 DeltaMS23.start = DeltaMS23.end = 2.7;
00044
00045 Delta.isfixed = false;
00046 Delta.start = 0; Delta.end = 2.0;
00047
00048 SinS2Th13.isfixed = false;
00049 SinS2Th13.start = 0.0; SinS2Th13.end = 0.4;
00050
00051 density = 2.65;
00052 }
|
|
||||||||||||
|
Definition at line 204 of file NueSenseConfig.cxx. References fDataMethod, found, number, signuehfile, and signuehname. Referenced by ReadInput(). 00205 {
00206 if(fDataMethod != 1 && fDataMethod != 2){
00207 std::cout<<"Error in config file, invalid data input"<<std::endl;
00208 return;
00209 }
00210
00211 std::string temp;
00212 found[nuClass] = true;
00213
00214 while (line.find(" ",0)<line.size())
00215 line.replace(line.find(" ",0),1,"");
00216
00217 if(line.find("Number") != std::string::npos){
00218 temp = line.substr(line.find("{")+1,line.find("}")-line.find("{")-1);
00219 number[nuClass] = atof(temp.c_str());
00220 } else if(line.find("Hist") != std::string::npos){
00221 if(fDataMethod != 2) {
00222 std::cout<<"Error in config file, invalid data input"<<std::endl;
00223 return;
00224 }
00225 signuehfile = line.substr(line.find("{")+1,
00226 line.find_first_of(",")-line.find("{")-1);
00227 signuehname = line.substr(line.find_last_of(",")+1,
00228 line.find("}")-line.find_last_of(",")-1);
00229 }
00230 else{
00231 found[nuClass] = false;
00232 }
00233 }
|
|
||||||||||||
|
Definition at line 235 of file NueSenseConfig.cxx. References NSCDataParam::end, NSCDataParam::isfixed, and NSCDataParam::start. Referenced by ReadInput(). 00236 {
00237 std::string temp;
00238 while (line.find(" ",0)<line.size())
00239 line.replace(line.find(" ",0),1,"");
00240
00241 temp = line.substr(line.find("{")+1,
00242 line.find_first_of(",")-line.find("{")-1);
00243 par.start = atof(temp.c_str());
00244 temp = line.substr(line.find_last_of(",")+1,
00245 line.find("}")-line.find_last_of(",")-1);
00246 par.end = atof(temp.c_str());
00247
00248 par.isfixed = false;
00249 if(line.find("fix")!=std::string::npos) par.isfixed = true;
00250 }
|
|
|
Definition at line 82 of file NueSenseConfig.h. Referenced by NueSensitivity::Initialize(), and NueFCSensitivity::Initialize(). 00082 {return fMustDeOsc; }
|
|
|
Definition at line 133 of file NueSenseConfig.h. Referenced by CheckConfig(), and ReadInput(). |
|
|
Definition at line 123 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 126 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 122 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 129 of file NueSenseConfig.h. Referenced by ReadInput(), and Reset(). |
|
|
Definition at line 134 of file NueSenseConfig.h. Referenced by CheckConfig(), and ReadInput(). |
|
|
Definition at line 112 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), Reset(), and SetDataInfo(). |
|
|
Definition at line 120 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 119 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 118 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 114 of file NueSenseConfig.h. Referenced by CheckConfig(), Reset(), and SetDataInfo(). |
|
|
Definition at line 113 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 131 of file NueSenseConfig.h. Referenced by CheckConfig(), Reset(), and SetDataInfo(). |
|
|
Definition at line 115 of file NueSenseConfig.h. Referenced by CheckConfig(), and SetDataInfo(). |
|
|
Definition at line 116 of file NueSenseConfig.h. Referenced by CheckConfig(), and SetDataInfo(). |
|
|
Definition at line 127 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 124 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
|
|
Definition at line 128 of file NueSenseConfig.h. Referenced by CheckConfig(), ReadInput(), and Reset(). |
1.3.9.1