2 void DrawPolySignal(TH2* h2_vt,
const int i_evt_b,
const int i_evt_e,
const int time_b,
const int time_e);
8 gSystem->mkdir(
"result",
true);
26 TTimeStamp ts0(2024, 2, 8, 18, 0, 0);
27 int utime0 = ts0.GetSec() + TTimeStamp::GetZoneOffset();
32 double RF_lo = RFFreq - RFMod;
33 double RF_hi = RFFreq + RFMod;
34 double sig_min, sig_max;
36 TH2* h2_vt =
new TH2D(
"h2_vt",
"", ScanSteps, RF_lo, RF_hi, 100, sig_min, sig_max);
38 const int n_draw_step = 50;
44 for (
int i_evt = 0; i_evt < n_evt; i_evt++) {
46 int evt_num = evt->
GetInt(
"EventNum");
47 if (utime0 == 0) utime0 = evt_num;
48 if (evt_num < utime0)
continue;
54 i_evt_draw = i_evt_ok;
58 for (
int ii = 0; ii < ScanSteps; ii++) {
59 double rf = RF_lo + 2.0 * RFMod / (ScanSteps - 1) * ii;
62 if ((i_evt_ok + 1) % n_draw_step == 0 ||
64 DrawPolySignal(h2_vt, i_evt_draw, i_evt_ok, utime_draw-utime0, evt_num-utime0);
78 void DrawPolySignal(TH2* h2_vt,
const int i_evt_b,
const int i_evt_e,
const int time_b,
const int time_e)
80 TCanvas* c1 =
new TCanvas(
"c1",
"");
82 gStyle->SetOptStat(0);
83 TGaxis::SetMaxDigits(4);
86 oss <<
"Data #" << i_evt_b <<
"-" << i_evt_e <<
" ("
87 << fixed << setprecision(2) << time_b/3600.0 <<
"-" << time_e/3600.0
88 <<
" hours);Frequency;PolySignal";
89 h2_vt->SetTitle(oss.str().c_str());
92 oss << setfill(
'0') <<
"result/h2_vt_" << setw(6) << i_evt_b <<
".png";
93 c1->SaveAs(oss.str().c_str());
void ana_NMR_poly_signal()
void DrawPolySignal(TH2 *h2_vt, const int i_evt_b, const int i_evt_e, const int time_b, const int time_e)
NMRSignal * GetPolySignal(const int evt_num)
void ReadEventFile(const std::string label)
void GetScanParam(int &ScanSweeps, int &ScanSteps, double &RFFreq, double &RFMod)
void Verb(const int verb)
NMREvent * GetEvent(const int index)
void GetPolySignalRange(double &min, double &max)
int GetInt(const int idx)
double GetPoint(const int idx)