42 #define SC_SAMPLE_CF 3
43 #define SC_PRESSURE_SC_GJ 4
44 #define SC_SAMPLE_HV 5
45 #define SC_SAMPLE_ZERO_FLUX 6
59 INT
sc_ana(EVENT_HEADER*,
void*);
60 INT
sc_bor(INT run_number);
61 INT
sc_eor(INT run_number);
65 "T. Prokscha, A. Suter",
73 (
const char **)sc_ana_param_str,
114 INT status, size, ival, success;
121 cm_get_experiment_database(&hDB, NULL);
122 status = db_find_key(hDB, 0,
"/Equipment/SampleCryo/Settings/Devices/Lake336_Sample_0/DD/Loop1/CTRL_CH", &hKey);
123 if (status != DB_SUCCESS) {
124 cm_msg(MINFO,
"sc_bor",
"analyzer/sc_ana_module/sc_bor: couldn't obtain sample cryo ctrl channel key.");
127 success = db_get_data(hDB, hKey, str, &size, TID_STRING);
128 if (status != DB_SUCCESS) {
129 cm_msg(MINFO,
"sc_bor",
"analyzer/sc_ana_module/sc_bor: couldn't obtain sample cryo ctrl channel value");
131 success = db_find_key(hDB, 0,
"/Analyzer/Parameters/SCAnaModule/sample_CF_CTRL_channel", &hKey);
132 if (strstr(str,
"A")) {
135 db_set_data(hDB, hKey, &ival, size, 1, TID_INT);
139 db_set_data(hDB, hKey, &ival, size, 1, TID_INT);
157 char name[256], title[256];
183 cm_get_experiment_database(&hDB, NULL);
184 status = db_find_key(hDB, 0,
"/Equipment/SlowControl/Common/Period", &hKey);
185 if (status != DB_SUCCESS) {
186 cm_msg(MERROR,
"sc_eor",
"sc_eor: couldn't obtain the reading period, will assume 30 sec.");
190 status = db_get_data(hDB, hKey, &odb_period, &size, TID_INT);
191 if (status == DB_SUCCESS) {
192 period = (double) odb_period / 1.0e3;
194 cm_msg(MERROR,
"sc_eor",
"sc_eor: couldn't obtain the reading period, will assume 30 sec.");
204 hSC_Hist[i] =
new TH1F(name, title, nbin, -period*0.5, ((
double)nbin+0.5)*period);
206 cm_msg(MERROR,
"sc_eor",
"sc_eor: hSC_Hist[%d]==0!! Cannot book the slow control histograms.", i);
211 hSC_Hist[i]->GetXaxis()->SetTitle(
"time (sec since SOR)");
235 INT
sc_ana(EVENT_HEADER *pheader,
void *pevent)
238 float *ptdc, field, current;
240 double meanModeratorHV, meanSampleHV, meanSampleT, meanSampleB;
241 double errorModeratorHV, errorSampleHV, errorSampleT, errorSampleB;
245 n = bk_locate(pevent,
"MMOD", &ptdc);
254 n = bk_locate(pevent,
"MSAM", &ptdc);
261 n = bk_locate(pevent,
"MVAC", &ptdc);
268 n = bk_locate(pevent,
"MHVT", &ptdc);
277 n = bk_locate(pevent,
"M900", &ptdc);
280 current = ptdc[ind]/10.*500.;
291 meanModeratorHV = 0.0;
296 errorModeratorHV = 0.0;
336 mean.
sample_t = (float) meanSampleT;
337 mean.
sample_b = (float) meanSampleB;
344 cm_get_experiment_database(&hDB, NULL);
345 db_find_key(hDB, 0,
"/Equipment/SlowControl/Variables/MEAN", &hKey);
346 db_set_record(hDB, hKey, &mean,
sizeof(mean), 0);
INT32 sample_zeroflux_channel
struct SCANAMODULE_PARAM::@16 histotitles
std::vector< std::vector< double > > sc_histo_vec
INT sc_ana(EVENT_HEADER *, void *)
INT32 sample_cf_ctrl_channel
SCANAMODULE_PARAM sc_ana_param
#define SC_SAMPLE_ZERO_FLUX
TObjArray * gHistoFolderStack
TRIGGER_SETTINGS trigger_settings
INT sc_bor(INT run_number)
SCANAMODULE_PARAM_STR(sc_ana_param_str)
#define SC_PRESSURE_SC_GJ
TFolder * gManaHistosFolder
INT sc_eor(INT run_number)
static TH1F * hSC_Hist[N_SC_HIST]
INT32 sample_sc_gj_channel
float get_magnetic_field(float current)