- Timestamp:
- 08/10/20 17:02:20 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/spectrum.cc
r19974 r19980 154 154 ("source-key", var<uint16_t>(5), "Source key to be used in data file selection.") 155 155 ("selector", vars<string>(), "WHERE clause to be used in data file selection.") 156 ("selsim", vars<string>(), "WHERE clause to be used in monte carlo file selection.") 156 157 ("estimator", var<string>()->required(), "Energy estimator to be used.") 157 158 ("spectrum", var<string>()->required(), "Spectral shape for re-weighting of simulated 'Energy'") … … 190 191 "Usage: spectrum [-u URI] [options]\n" 191 192 "\n" 193 "Note that default analysis query is built into the executable. If a changed " 194 "query should be used, it is not enough to just change the file, but the " 195 "--analysis command line option has to be explicitly specified.\n" 192 196 ; 193 197 cout << endl; … … 547 551 catch (const mysqlpp::BadConversion &b) 548 552 { 549 cerr << b.what()<< endl;553 cerr << "\033[31m" << b.what() << "\033[0m" << endl; 550 554 } 551 555 } … … 636 640 Binning binning_impact = conf.Get<Binning>("impact"); 637 641 638 cout << '\n'; 642 cout << "\nIt is " << start.Iso() << "\n\n"; 643 639 644 cout << "Binning 'theta': " << binning_theta.str() << endl; 640 645 cout << "Binning 'dense': " << binning_dense.str() << endl; … … 644 649 const uint16_t source_key = conf.Get<uint16_t>("source-key"); 645 650 const string where = boost::join(conf.Vec<string>("selector"), " AND\n "); 651 const string where_sim = boost::join(conf.Vec<string>("selsim"), " AND\n "); 646 652 const string estimator = conf.Get<string>("estimator"); 647 653 const string spectrum = conf.Get<string>("spectrum"); … … 888 894 " ON\n" 889 895 " (ThetaMin>=lo AND ThetaMin<hi) OR (ThetaMax>lo AND ThetaMax<=hi)\n" 896 " LEFT JOIN\n" 897 " factmc.SetInfo USING (SetKEY, PartId)\n" 890 898 " WHERE\n" 891 " PartId=1 AND\n" 892 " FileId%%2=0\n" 899 " PartId=1 %101:where\n" 893 900 " ORDER BY\n" 894 901 " FileId\n" // In order: faster … … 898 905 //for (auto it=env.cbegin(); it!=env.cend(); it++) 899 906 // query3.template_defaults[it->first.c_str()] = it->second.c_str(); 907 908 if (!where_sim.empty()) 909 query3.template_defaults["where"] = ("AND\n "+where_sim).c_str(); 900 910 901 911 if (print_queries) … … 1098 1108 " OnTime,\n" 1099 1109 " OnTime/CountN AS ZdWeight,\n" 1110 /* 1s per 300s 1/CountN = [sqrt(CountN)/CountN]^2 */ 1100 1111 " (OnTime/CountN)*SQRT(POW(1/300, 2) + 1/CountN) AS ErrZdWeight\n" 1101 1112 " FROM\n" … … 2332 2343 "mg.DrawClone(\"A\");\n\n" 2333 2344 "gPad->SetLogx();\n" 2334 "gPad->SetLogy();\n"; 2345 "gPad->SetLogy();\n" 2346 "\n" 2347 "TF1 f(\"Power Law\", \"[0]*(x/1000)^[1]\", g->GetX()[0], g->GetX()[g->GetN()-1]);\n" 2348 "f.SetParameter(0, 1e-11);\n" 2349 "f.SetParameter(1, -2.6);\n" 2350 "g->Fit(&f, \"\", \"NOQ\");\n" 2351 "f.SetLineColor(kBlue);\n" 2352 "f.DrawCopy(\"same\");\n" 2353 "\n" 2354 "cout << \"\\nChi^2/NDF: \" << f.GetChisquare() << \" / \" << f.GetNDF() << '\\n';\n" 2355 "cout << \"Probability: \" << f.GetProb() << '\\n' << endl;\n"; 2356 2335 2357 mlog << indent(0) << "}" << endl; 2336 2358
Note:
See TracChangeset
for help on using the changeset viewer.