43 #define SC_SAMPLE_CF 3
44 #define SC_PRESSURE_SC_GJ 4
45 #define SC_SAMPLE_HV 5
46 #define SC_SAMPLE_ZERO_FLUX 6
60 INT
sc_ana(EVENT_HEADER*,
void*);
61 INT
sc_bor(INT run_number);
62 INT
sc_eor(INT run_number);
66 "T. Prokscha, A. Suter",
74 (
const char **)sc_ana_param_str,
115 INT status, size, ival, success;
122 cm_get_experiment_database(&hDB, NULL);
123 status = db_find_key(hDB, 0,
"/Equipment/SampleCryo/Settings/Devices/Lake340_Sample_0/DD/Loop1/CTRL_CH", &hKey);
124 if (status != DB_SUCCESS) {
125 cm_msg(MINFO,
"sc_bor",
"analyzer/sc_ana_module/sc_bor: couldn't obtain sample cryo ctrl channel key.");
128 success = db_get_data(hDB, hKey, str, &size, TID_STRING);
129 if (status != DB_SUCCESS) {
130 cm_msg(MINFO,
"sc_bor",
"analyzer/sc_ana_module/sc_bor: couldn't obtain sample cryo ctrl channel value");
132 success = db_find_key(hDB, 0,
"/Analyzer/Parameters/SCAnaModule/sample_CF_CTRL_channel", &hKey);
133 if (strstr(str,
"A")) {
136 db_set_data(hDB, hKey, &ival, size, 1, TID_INT);
140 db_set_data(hDB, hKey, &ival, size, 1, TID_INT);
159 char name[256], title[256];
185 cm_get_experiment_database(&hDB, NULL);
186 status = db_find_key(hDB, 0,
"/Equipment/SlowControl/Common/Period", &hKey);
187 if (status != DB_SUCCESS) {
188 cm_msg(MERROR,
"sc_eor",
"sc_eor: couldn't obtain the reading period, will assume 30 sec.");
192 status = db_get_data(hDB, hKey, &odb_period, &size, TID_INT);
193 if (status == DB_SUCCESS) {
194 period = (double) odb_period / 1.0e3;
196 cm_msg(MERROR,
"sc_eor",
"sc_eor: couldn't obtain the reading period, will assume 30 sec.");
206 hSC_Hist[i] =
new TH1F(name, title, nbin, -period*0.5, ((
double)nbin+0.5)*period);
208 cm_msg(MERROR,
"sc_eor",
"sc_eor: hSC_Hist[%d]==0!! Cannot book the slow control histograms.", i);
213 hSC_Hist[i]->GetXaxis()->SetTitle(
"time (sec since SOR)");
237 INT
sc_ana(EVENT_HEADER *pheader,
void *pevent)
240 float *ptdc, field, current;
242 double meanModeratorHV, meanSampleHV, meanSampleT, meanSampleB;
243 double errorModeratorHV, errorSampleHV, errorSampleT, errorSampleB;
247 n = bk_locate(pevent,
"MMOD", &ptdc);
256 n = bk_locate(pevent,
"MSAM", &ptdc);
263 n = bk_locate(pevent,
"MVAC", &ptdc);
270 n = bk_locate(pevent,
"MHVT", &ptdc);
279 n = bk_locate(pevent,
"M900", &ptdc);
282 current = ptdc[ind]/10.*500.;
293 meanModeratorHV = 0.0;
298 errorModeratorHV = 0.0;
346 cm_get_experiment_database(&hDB, NULL);
347 db_find_key(hDB, 0,
"/Equipment/SlowControl/Variables/MEAN", &hKey);
348 db_set_record(hDB, hKey, &
mean,
sizeof(
mean), 0);
INT sample_cf_ctrl_channel
#define SC_PRESSURE_SC_GJ
struct SCANAMODULE_PARAM::@16 histotitles
INT sc_bor(INT run_number)
vector< vector< double > > sc_histo_vec
RUNINFO runinfo
/Runinfo ODB key, defined in from midas.h
SCANAMODULE_PARAM_STR(sc_ana_param_str)
TObjArray * gHistoFolderStack
INT sc_eor(INT run_number)
INT sample_zeroflux_channel
INT sc_ana(EVENT_HEADER *, void *)
#define SC_SAMPLE_ZERO_FLUX
TRIGGER_SETTINGS trigger_settings
/Equipment/Trigger/Settings
static TH1F * hSC_Hist[N_SC_HIST]
float get_magnetic_field(float current)
SCANAMODULE_PARAM sc_ana_param
TFolder * gManaHistosFolder