Low-Energy Muon (LEM) Experiment  0.5.2
write_summary.cxx
Go to the documentation of this file.
1 /********************************************************************\
2 
3  midas/experiment/nemu/write_summary.cxx
4 
5  Name: write_summary.cxx
6  Created by: Thomas Prokscha
7  Date: 21-Oct-2005
8 
9  Contents: Program to create Nemu summary file;
10  It is called at Start-of-Run and end-of-run.
11 
12 
13 \********************************************************************/
14 
15 /* standard includes */
16 #include <cstdio>
17 #include <cstring>
18 #include <ctime>
19 
20 #include "midas.h"
21 #include "msystem.h"
22 
23 #define MAXLINE 160
24 #define N_FUG 16
25 #define MODERATOR_HV_CHANNEL 4
26 #define SAMPLE_HV_CHANNEL 15
27 #define SPINROTATOR_VOLTAGE_CHANNEL 2
28 #define SPINROTATOR_CURRENT_CHANNEL 3
29 
30 // ODB structures
31 #include "experim.h"
32 
33 // LEM specific definitions
34 #include "nemu_experim.h"
35 
36 #define N_ELEMENTS 23
37 const char *odbElements[] = {"/Runinfo",
38  "/Experiment/Run Parameters",
39  "/Equipment/Trigger/Settings",
40  "/Equipment/Trigger/Vme_Statistics",
41  "/Equipment/Scaler/Settings",
42  "/Analyzer/Parameters/ScalerSumRate",
43  "/Equipment/HV/Settings",
44  "/Equipment/HV/Variables",
45  "/Equipment/HV Detectors/Settings",
46  "/Equipment/HV Detectors/Variables",
47  "/Equipment/Beamline/Settings",
48  "/Equipment/Beamline/Variables",
49  "/Equipment/ModCryo/Settings",
50  "/Equipment/ModCryo/Variables",
51  "/Equipment/SampleCryo/Settings",
52  "/Equipment/SampleCryo/Variables",
53  "/Equipment/LEMVAC/Settings",
54  "/Equipment/LEMVAC/Variables",
55  "/Equipment/SCS2001M/Variables",
56  "/Equipment/SlowControl/Variables/MEAN",
57  "/Analyzer/Parameters/TOFAnaModule",
58  "/Equipment/Danfysik_Spin_Rot/Variables",
59  "/Equipment/Omega/Variables",
60  };
61 
62 typedef struct{
63  RUNINFO runinfo;
81 // SCS900_EVENT scs900_event;
87 } ODB;
88 
90 void *podb;
92 
93 /* other global variable */
94 FILE *file;
95 char sumfile[256];
96 char line[MAXLINE];
97 HNDLE hDB, hKey;
98 
99 /* function declarations */
100 INT open_odb_records(void);
101 INT create_sum_filename( char *filename, const char *flag );
102 INT write_sum_file(char *filename);
103 void strcut(char *result, char *orgstr, char *cutstr);
104 INT write_hvtrans(FILE *f);
105 INT write_hvdet(FILE *f);
106 INT write_trigger(FILE *f);
107 INT write_beamline(FILE *f);
108 INT write_env(FILE *f);
109 INT write_temp(FILE *f, BOOL running);
110 void write_control_room_scaler(FILE *f);
111 INT write_eloss(FILE *f);
112 INT write_t0(FILE *f);
113 INT write_rates(FILE *f, double norm, double ip_norm, double scaler_sum, const char* label);
114 INT display_scaler(FILE *f);
115 
116 /*-----------------------------------------------------------------*/
118 /* *****************************************************************\
119 
120  Name: open_odb_records
121  Author: Thomas Prokscha
122  Date: 09-Nov-2001
123 
124  Purpose: open odb records for later extraction of data to
125  be written to the summary file
126 
127  Function value:
128  DB_SUCCESS Successful completion
129  status in case of error: value of db_ function.
130 
131 \* ****************************************************************** */
132 {
133  INT status, size, size1=0, i;
134  char odbkey[132];
135 
136 /* --------------------------------
137  create /Info key and get record
138  -------------------------------- */
139  sprintf(odbkey, "/Info");
140  db_find_key(hDB, 0, odbkey, &hKey);
141  size = sizeof(info);
142  status = db_get_record(hDB, hKey, &info, &size, 0);
143  if ( status != DB_SUCCESS ){
144  cm_msg(MERROR,"open_odb_records", "Could not open %s record.", odbkey);
145  return status;
146  }
147 
148  // get other records
149  podb = &odb;
150  for (i=0; i < N_ELEMENTS; i++){
151  status = db_find_key(hDB, 0, odbElements[i], &hKey);
152  if ( status != DB_SUCCESS ){
153  cm_msg(MERROR,"open_odb_records", "Could not find %s key.", odbElements[i]);
154  return status;
155  }
156  else {
157  switch (i) {
158  case 0: size = sizeof(RUNINFO); break;
159  case 1: size = sizeof(EXP_PARAM); break;
160  case 2: size = sizeof(TRIGGER_SETTINGS); break;
161  case 3: size = sizeof(VME_STATS); break;
162  case 4: size = sizeof(SCALER_SETTINGS); break;
163  case 5: size = sizeof(SCALERSUMRATE_PARAM); break;
164  case 6: size = sizeof(HV_SETTINGS); break;
165  case 7: size = sizeof(HV_EVENT); break;
166  case 8: size = sizeof(HV_DETECTORS_SETTINGS); break;
167  case 9: size = sizeof(HV_DETECTORS_EVENT); break;
168  case 10: size = sizeof(BEAMLINE_SETTINGS); break;
169  case 11: size = sizeof(BEAMLINE_EVENT); break;
170  case 12: size = sizeof(MODCRYO_SETTINGS); break;
171  case 13: size = sizeof(MODCRYO_EVENT); break;
172  case 14: size = sizeof(SAMPLECRYO_SETTINGS); break;
173  case 15: size = sizeof(SAMPLECRYO_EVENT); break;
174  case 16: size = sizeof(LEMVAC_SETTINGS); break;
175  case 17: size = sizeof(LEMVAC_EVENT); break;
176 // case 18: size = sizeof(SCS900_EVENT); break;
177  case 18: size = sizeof(SCS2001M_EVENT); break;
178  case 19: size = sizeof(MEAN_BANK); break;
179  case 20: size = sizeof(TOFANAMODULE_PARAM); break;
180  case 21: size = sizeof(DANFYSIK_SPIN_ROT_EVENT); break;
181  case 22: size = sizeof(OMEGA_EVENT); break;
182  default: break;
183  }
184 // printf("%d %d\n", i, size);
185  status = db_get_record(hDB, hKey, podb, &size, 0);
186  podb+=size;
187  size1+=size;
188  if (status != DB_SUCCESS) {
189  cm_msg(MERROR,"open_odb_records", "Could not open %s record.", odbElements[i]);
190  return status;
191  }
192  }
193  }
194 /* printf("%d %d\n", sizeof(odb), size1);
195  printf("%s\n", odb.trigger_settings.events.comment);
196  printf("%s\n", odb.exp_param.comment);
197  printf("%f\n", odb.danfysik_spin_rot_event.output[3]);*/
198  return DB_SUCCESS;
199 }
200 
201 /* -----------------------------------------------------------------*/
202 INT create_sum_filename( char *filename, const char *flag )
203 /* ***************************************************************** *\
204 
205  Name: create_sum_filename
206  Author: Thomas Prokscha
207  Date: 22-May-2001
208 
209  Purpose: create filename for Run summary files of
210  the Nemu experiment.
211  Runs on Unix and Windows NT
212 
213  11-Sep-2001 TP:
214  changed filename to ../summ/lem%02d_%04d.summ where
215  %02d is replaced by the year modulo 100.
216 
217  Look for MIDAS_DATA variable ( == /data/nemu on PC3159),
218  and build the filename of the summary file in the form
219  MIDAS_DATA/summ/nemu_%04d.summ, where %04d is the four
220  digit run number extracted from the ODB.
221  If MIDAS_DATA is not defined the HOME path is taken as
222  default location for the summary file. In this case a
223  message is broadcasted to all MIDAS clients using cm_msg.
224  The message is additionally written to the file midas.log
225  (located in MIDAS_DATA/log on PC3159).
226 
227  Input: char *flag: if flag == 'N' use current run number from ODB,
228  otherwise use run number-1 (the previous run).
229 
230 
231  Output: char *filename, the name of the summary file
232 
233 
234  Function value:
235  SS_SUCCESS Successful completion
236 
237 \* ****************************************************************** */
238 {
239  struct tm *tms;
240  time_t now;
241  char dir[256], filebody[256];
242 
243  dir[0] = 0;
244  filebody[0] = 0;
245 
246  if ( getenv("MIDAS_DATA") ){
247  strcpy(dir, getenv("MIDAS_DATA"));
248  strcat(dir, DIR_SEPARATOR_STR);
249  strcat(dir, "summ");
250  strcat(dir, DIR_SEPARATOR_STR);
251  }
252  else{
253 #if defined (OS_UNIX)
254  strcpy(dir, getenv("HOME"));
255 #elif defined (OS_WINNT)
256  strcpy(dir, getenv("HOMEPATH"));
257 #endif
258  strcat(dir, DIR_SEPARATOR_STR);
259  cm_msg(MINFO, "create_sum_filename",
260  "MIDAS_DATA path not defined, use home directory %s instead\n", dir);
261  }
262 
263  time(&now);
264  tms = localtime(&now);
265  // tms->tm_year yields "Year - 1900"
266 
267  strcpy(filename, dir);
268  if ( flag == "N")
269  sprintf(filebody, "%04d/lem%02d_%04d.summ", tms->tm_year+1900,
270  tms->tm_year%100, odb.runinfo.run_number);
271  else
272  sprintf(filebody, "%04d/lem%02d_%04d.summ", tms->tm_year+1900,
273  tms->tm_year%100, odb.runinfo.run_number-1);
274 
275  strcat(filename, filebody);
276 
277  return SS_SUCCESS;
278 }
279 
280 /* --------------------------------------------------------- */
281 INT write_sum_file(char *filename)
282 /* ***************************************************************** *\
283 
284  Name: write_sum_filename
285  Author: Thomas Prokscha
286  Date: 22-May-2001
287 
288  Purpose: writes summary file of Nemu experiment.
289  Runs on Unix and (Windows NT, not yet).
290 
291  Input: char *filename, the name of the summary file
292 
293 
294  Output: None
295 
296 
297  Function value:
298  SS_SUCCESS Successful completion
299  -1 Error opening new summary file
300 
301 
302 \* ****************************************************************** */
303 {
304  FILE *fprevious;
305  char beginComment[] =
306  "#BUC---- B e g i n of User Comment ------ Do not edit this line";
307  char endComment[] =
308  "#EUC---- E n d of User Comment ------ Do not edit this line";
309  char bucpattern[5] = "#BUC";
310  char eucpattern[5] = "#EUC";
311  char pattern[5], underline[MAXLINE], previousfile[256];
312  char cmd[256];
313  BOOL prevfile=FALSE, cont=FALSE, dowrite=FALSE, running=FALSE;
314  int i, len;
315  INT size;
316 
317  /* initialise */
318  line[0] = 0;
319  pattern[0] = 0;
320  previousfile[0] = 0;
321  cmd[0] = 0;
322 
323  /* -----------------------------
324  check if file already exists
325  (that is we are at end of run...)
326  -----------------------------*/
327  file = fopen(filename, "r");
328  if ( file != NULL){
329  fclose(file);
330  prevfile = TRUE;
331  running = TRUE;
332  sprintf(previousfile,"%s.old", filename);
333  sprintf(cmd, "cp %s %s", filename, previousfile);
334  system(cmd);
335  fprevious = fopen(previousfile, "r");
336  }
337  else{
338  /* -------------------------------
339  check if previous run summary file
340  exists; if yes copy the user comment
341  lines to the new file
342  --------------------------------*/
343  create_sum_filename(previousfile, "P");
344  fprevious = fopen(previousfile, "r");
345  if ( fprevious != NULL ){
346  prevfile = TRUE;
347  running = FALSE;
348  }
349  else{
350  prevfile = FALSE;
351  running = FALSE;
352  }
353  }
354 
355  /* ------------------------------
356  open file in write mode
357  ------------------------------*/
358  file = fopen(filename, "w");
359  if ( file == NULL ){ /* error opening file, return and send error message */
360  cm_msg(MERROR, "write_sum_file", "Error opening summary file %s",
361  filename);
362  return -1;
363  }
364 
365  /* ------------------------------
366  write file header and comments
367  ------------------------------*/
368  sprintf(line, "%s Run %04d started.\n", odb.runinfo.start_time,
369  odb.runinfo.run_number);
370  fputs(line, file);
371 
372  if ( !running )
373  sprintf(line, "%s Run %04d stopped.\n\n", odb.runinfo.stop_time,
374  odb.runinfo.run_number-1);
375  else
376  sprintf(line, "%s Run %04d stopped.\n\n", odb.runinfo.stop_time,
377  odb.runinfo.run_number);
378 
379  fputs(line, file);
380 
381  if ( strlen(odb.exp_param.comment) > 132 );
382  odb.exp_param.comment[132] = 0;
383 
384  sprintf(line, " %s\n", odb.exp_param.comment);
385  fputs(line, file);
386 
387  len = strlen(line);
388  for ( i=0; i<len; i++)
389  underline[i] = '=';
390  underline[len] = 0;
391  sprintf(line, " %s\n\n", underline);
392  fputs(line, file);
393 
394  sprintf(line, "%s\n", beginComment);
395  fputs(line, file);
396 
397  if ( prevfile ){
398  cont = TRUE;
399  dowrite = FALSE;
400  while ( cont ){
401  if ( fgets(line, MAXLINE, fprevious) == NULL){
402  dowrite = FALSE;
403  cont = FALSE;
404  break;
405  }
406  if ( dowrite )
407  fputs(line, file);
408  for ( i = 0; i<4; i++ )
409  pattern[i] = line[i];
410  pattern[4] = 0;
411  if ( strcmp(pattern, bucpattern) == 0 )
412  dowrite = TRUE;
413  if ( strcmp(pattern, eucpattern) == 0 )
414  cont = FALSE;
415  }
416  fclose(fprevious);
417  if ( running )
418  unlink(previousfile);
419  }
420 
421  if ( !prevfile){
422  sprintf(line, "\n\n%s\n\n\n", endComment);
423  fputs(line, file);
424  }
425  else{
426  sprintf(line, "\n\n\n");
427  fputs(line, file);
428  }
429 /* --------------------------------------------------
430 
431  now, header with comments are written, write other
432  experiment parameters
433 
434  - transport system high voltage
435  - trigger settings
436  - the beamline settings
437  - scaler sum and rates at the end of summary file
438 
439  --------------------------------------------------
440 */
443  write_eloss(file);
444  write_t0(file);
446  write_env(file);
447  write_temp(file, running);
449  write_hvdet(file);
451 /* --------------------------------------------------
452  close file and return
453  --------------------------------------------------
454 */
455  fclose(file);
456  return SS_SUCCESS;
457 }
458 /*---------------------------------------------------------------*/
459 void strcut(char *result, char *orgstr, char *cutstr)
460 /*----------------------------------------------------
461 
462  Purpose: look, if cutstr is at the beginning of orgstr.
463  if yes, copy orgstr starting after cutstr to
464  result. If not, copy orgstr to result.
465  quicky version...
466  -----------------------------------------------------*/
467 {
468  int len, j;
469  char tempstr[80];
470 
471  len = strlen(cutstr);
472  strcpy(tempstr, orgstr);
473  tempstr[len] = 0;
474  if ( strcmp(tempstr, cutstr) == 0 ){
475  j = 0;
476  while ( (result[j] = orgstr[j+len]) != '\0')
477  j++;
478  }
479  else
480  strcpy(result, orgstr);
481  return;
482 }
483 /*-----------------------------------------------------------------*/
484 INT write_hvtrans(FILE *f)
485 /* ---------------------------
486  Transport system HVq
487  ---------------------------*/
488 {
489  INT i;
490  char name0[32], name1[32];
491  char group[5] = "FUG%";
492 
493  sprintf(line, "\nTransport-HV:\n");
494  fputs(line, f);
495  sprintf(line, "===============\n");
496  fputs(line, f);
497 
498 // cut of FUG% if found in string
499  for ( i = 0; i<N_FUG; i+=2){
500  strcut(name0, odb.hv_settings.names[i], group);
501  strcut(name1, odb.hv_settings.names[i+1], group);
502  sprintf(line, " %15s = %8.3f kV\t %15s = %8.3f kV\n",
503  name0, odb.hv_event.measured[i], name1, odb.hv_event.measured[i+1]);
504  fputs(line, f);
505  }
506  // add mean of moderator and sample HV
507  sprintf(line, " Mean Moderator = %8.3f(%5.3f) kV\t Mean Sample = %8.3f(%5.3f) kV\n",
510  fputs(line, f);
511  // add spin-rotator current
512  sprintf(line, " SR Current = %8.3f A\t\t SR Voltage = %8.3f V\n",
515  fputs(line, f);
516  // add spin-rotator angle
517  sprintf(line, " SR Angle = %8.3f degree\n", info.spinrot_parameter.rotation_angle);
518  fputs(line, f);
519 
520  return SS_SUCCESS;
521 }
522 /*-----------------------------------------------------------------*/
523 INT write_eloss(FILE *f)
524 /* -----------------------------------------------
525  energy loss in C-foil, implantation energy
526  -----------------------------------------------*/
527 {
528  float eloss, implantation_energy;
529 
530  sprintf(line, "\nMuon Energy:\n");
531  fputs(line, f);
532  sprintf(line, "===============\n");
533  fputs(line, f);
534 
535  eloss = info.energy_loss;
536  implantation_energy = info.implantation_energy;
537 
538  sprintf(line, " energy loss = %8.3f keV implantation energy = %8.3f keV\n",
539  eloss, implantation_energy);
540  fputs(line, f);
541 
542  return SS_SUCCESS;
543 }
544 /*-----------------------------------------------------------------*/
545 INT write_t0(FILE *f)
546 /* -----------------------------------------------
547  calculated time zeros in decay histograms
548  -----------------------------------------------*/
549 {
550  INT i;
551 
552  sprintf(line, "\nCalculated t0's:\n");
553  fputs(line, f);
554  sprintf(line, "===============\n");
555  fputs(line, f);
556 
557  for (i=0; i<N_DECAY_HISTS; i++){
558  sprintf(line, " t0[%2d] = %8d\n", i, info.t0_parameter.t0[i]);
559  fputs(line, f);
560  }
561  return SS_SUCCESS;
562 }
563 /*---------------------------------------------------------------*/
564 INT write_trigger(FILE *f)
565 {
566  sprintf(line,"\n ====================== E v e n t definition =========================\n\n");
567  fputs(line,f);
568  sprintf(line," Events: \n %s\n\n", odb.trigger_settings.events.comment);
569  fputs(line,f);
570 
571  sprintf(line, " t0 Offset: %d\n", odb.trigger_settings.t0_offset);
572  fputs(line, f);
573 
574  sprintf(line, " Event 0: %d\t BC: %7d\t e+: %7d\n",
578  );
579  fputs(line,f);
580 
581  sprintf(line, " Event 1: %d\t BC: %7d\t e+: %7d\n",
585  );
586  fputs(line,f);
587 
588  sprintf(line, " Event 2: %d\t BC: %7d\t e+: 1\n",
591  );
592  fputs(line,f);
593 
594  sprintf(line, "\n Time windows: \n");
595  fputs(line,f);
596  sprintf(line, " ============= \n");
597  fputs(line, f);
598  sprintf(line, " Event 0: Data Window: %7d, TOF BC Window: %7d, TOF BC Pileup: %7d\n",
602  );
603  fputs(line,f);
604 
605  sprintf(line, " Event 1: Data Window: %7d, TOF M2 Window: %7d, TOF M2 Pileup: %7d\n",
609  );
610  fputs(line,f);
611 
612  sprintf(line, " Event 1: Data Window: %7d, TOF BC Window: %7d, TOF BC Pileup: %7d\n",
616  );
617  fputs(line,f);
618 
619  sprintf(line, " Event 2: Data Window: %7d, TOF BC Window: %7d, TOF BC Pileup: %7d\n",
623  );
624  fputs(line,f);
625 
626  sprintf(line, "\n Software delays: \n");
627  fputs(line,f);
628  sprintf(line, " ================ \n");
629  fputs(line, f);
630  sprintf(line, " Event 0: MCP1 : %7d, e+: %7d\n",
633  );
634  fputs(line,f);
635  sprintf(line, " Event 1: Master: %7d, e+: %7d\n",
638  );
639  fputs(line,f);
640  sprintf(line, " Event 2: TD : %7d, e+: %7d\n",
643  );
644  fputs(line,f);
645 
646 
647  sprintf(line, "\n Event 1: Master TD: %d, TD Active: %d, Master M2: %d, M2 Active %d\n",
652  );
653  fputs(line,f);
654 
655  sprintf(line, "\n TD-MCP2 TOF cuts: \n");
656  fputs(line,f);
657  sprintf(line, " ================= \n");
658  fputs(line, f);
659 
660  sprintf(line, " TOFcutMin : %7.0f, TOFcutMax: %7.0f\n",
661  odb.tof_param.tofm2fmin,
662  odb.tof_param.tofm2fmax
663  );
664  fputs(line, f);
665 
666  sprintf(line, "\n MCP2 beamspot parameter: \n");
667  fputs(line,f);
668  sprintf(line, " ======================== \n");
669  fputs(line, f);
670 
671  sprintf(line, " x Offset (mm) : %7.2f, y Offset (mm): %7.2f\n",
674  );
675  fputs(line, f);
676  sprintf(line, " scale factor : %7.2f, rotation angle (degree): %7.2f\n",
679  );
680  fputs(line, f);
681 
682 
683  return SS_SUCCESS;
684 }
685 /*---------------------------------------------------------------------*/
686 INT write_beamline(FILE *f)
687 {
688  INT i, nmax;
689  char str0[32], str1[32];
690 
691  sprintf(line, "\nBeamline:\n");
692  fputs(line, f);
693  sprintf(line, "=========");
694  fputs(line, f);
695  sprintf(line, "\n Beamline settings: %s\n\n", info.beamline_settings);
696  fputs(line, f);
697  nmax = sizeof(odb.beamline_event.measured)/4;
698 /* nmax = odb.beamline_settings.channels.magnets +
699  odb.beamline_settings.channels.kv61 +
700  odb.beamline_settings.channels.kv62 +
701  odb.beamline_settings.channels.sep61;*/
702  for ( i=0; i<nmax-1; i++){
703  strcpy(str0, odb.beamline_settings.names[i]);
704  strcpy(str1, odb.beamline_settings.names[i+1]);
705  str0[6] = 0; //truncate
706  str1[6] = 0;
707  sprintf(line," %s\t DAC = %5.0f ADC = %7.3f\t %s\t DAC = %5.0f ADC = %7.3f\n",
708  str0, odb.beamline_event.demand[i], odb.beamline_event.measured[i],
709  str1, odb.beamline_event.demand[i+1], odb.beamline_event.measured[i+1]);
710  fputs(line, f);
711  i++;
712  }
713  //sprintf(line, "\t\t SEP \t\t HV = %8.1f kV\n", info.separator.hv);
714  fputs(line, f);
715 
716  return SS_SUCCESS;
717 }
718 
719 INT write_hvdet(FILE *f)
720 {
721 /*//as35
722 #define N_CHANNELS 48
723  INT i, j;
724  char name[32];
725  char group[10] = "NHQ%";
726  char sign[2] = "-";
727  char *mcp[] = {"TD C Foil", "TD Front", "TD Back", "TD MCP", "MCP1", "MCP2"};
728  char *pos[] = {"L_i","L_a","T_i","T_a","R_i","R_a","B_i","B_a"};
729 
730  sprintf(line, "\nDetectors:\n");
731  fputs(line, f);
732  sprintf(line, "==========\n");
733  fputs(line, f);
734 
735  for ( i=0; i<N_CHANNELS; i++){
736  strcut(name, odb.hvdet_settings.names[i], group);
737  if ( strstr(name, "%" )) continue;
738  for ( j=0; j<6; j++)
739  {
740  if (strstr(name, mcp[j]))
741  {
742  sprintf(line, "\t %-20s\t = %8.3f kV\n", name, odb.hvdet_event.measured[i]);
743  fputs(line, f);
744  }
745 
746  }
747  }
748  //-------------------------
749  // the detector thresholds
750  //-------------------------
751  sprintf(line, "\nDetector thresholds:\n");
752  fputs(line, f);
753  sprintf(line, "====================\n");
754  fputs(line, f);
755 
756  sprintf(line, "\t\t BcL_1 = %6.1f mV\t BcL_2 = %6.1f mV\n", info.thresholds.bcl1, info.thresholds.bcl2);
757  fputs(line, f);
758  sprintf(line, "\t\t BcL_3 = %6.1f mV\t BcL_4 = %6.1f mV\n", info.thresholds.bcl3, info.thresholds.bcl4);
759  fputs(line, f);
760  sprintf(line, "\t\t BcR_1 = %6.1f mV\t BcR_2 = %6.1f mV\n", info.thresholds.bcr1, info.thresholds.bcr2);
761  fputs(line, f);
762  sprintf(line, "\t\t BcR_3 = %6.1f mV\t BcR_4 = %6.1f mV\n", info.thresholds.bcr3, info.thresholds.bcr4);
763  fputs(line, f);
764  sprintf(line, "\t\t Pos_MCP1_I = %6.1f mV\t MCP1 = %6.1f mV\n", info.thresholds.posmcp1i, info.thresholds.mcp1);
765  fputs(line, f);
766  sprintf(line, "\t\t Pos_MCP1_O = %6.1f mV\t MCP2_F = %6.1f mV\n", info.thresholds.posmcp1o, info.thresholds.mcp2f);
767  fputs(line, f);
768  sprintf(line, "\t\t MCP2_R = %6.1f mV\t TD = %6.1f mV\n", info.thresholds.mcp2r, info.thresholds.td);
769  fputs(line, f);
770  sprintf(line, "\t\t MCP2_Anode = %6.1f mV\t \n", info.thresholds.mcp2anode);
771  fputs(line, f);
772  sprintf(line, "\t\t Pos_LDI = %6.1f mV\t Pos_LDO = %6.1f mV\n", info.thresholds.posldi, info.thresholds.posldo);
773  fputs(line, f);
774  sprintf(line, "\t\t Pos_LUI = %6.1f mV\t Pos_LUO = %6.1f mV\n", info.thresholds.poslui, info.thresholds.posluo);
775  fputs(line, f);
776  sprintf(line, "\t\t Pos_TDI = %6.1f mV\t Pos_TDO = %6.1f mV\n", info.thresholds.postdi, info.thresholds.postdo);
777  fputs(line, f);
778  sprintf(line, "\t\t Pos_TUI = %6.1f mV\t Pos_TUO = %6.1f mV\n", info.thresholds.postui, info.thresholds.postuo);
779  fputs(line, f);
780  sprintf(line, "\t\t Pos_RDI = %6.1f mV\t Pos_RDO = %6.1f mV\n", info.thresholds.posrdi, info.thresholds.posrdo);
781  fputs(line, f);
782  sprintf(line, "\t\t Pos_RUI = %6.1f mV\t Pos_RUO = %6.1f mV\n", info.thresholds.posrui, info.thresholds.posruo);
783  fputs(line, f);
784  sprintf(line, "\t\t Pos_BDI = %6.1f mV\t Pos_BDO = %6.1f mV\n", info.thresholds.posbdi, info.thresholds.posbdo);
785  fputs(line, f);
786  sprintf(line, "\t\t Pos_BUI = %6.1f mV\t Pos_BUO = %6.1f mV\n", info.thresholds.posbui, info.thresholds.posbuo);
787  fputs(line, f);
788 
789 */
790  return SS_SUCCESS;
791 }
792 
793 /*--------------------*/
794 INT write_env(FILE *f)
795 /* **********************\
796 \* **********************/
797 {
798  INT i, j, size;
799  const char *press[] = {"MC_GJ ", "MC_GJ2", "TC_GJ ", "SC_GJ ", "SC_GJ2"};
800  const char *xtc[] = {"XTC_Th"};
801 
802  size = sizeof(odb.moddy_event.input)/sizeof(float);
803 
804  sprintf(line, "\nEnvironment:\n");
805  fputs(line, f);
806  sprintf(line, "============\n");
807  fputs(line, f);
808 
809  sprintf(line,"\t LEM Setup\t\t = %s\n", info.lem_setup);
810  fputs(line,f);
811  sprintf(line, "\t Sample Name\t\t = %s\n", info.sample_name);
812  fputs(line,f);
813  sprintf(line,"\t Sample Cryo\t\t = %s\n", info.sample_cryo);
814  fputs(line,f);
815 // sprintf(line,"\t Zero Flux\t\t = %10.4f V\n", odb.scs900_event.input[8]);
816  sprintf(line,"\t Zero Flux\t\t = %10.4f V\n", odb.scs2001m_event.input[31]);
817  fputs(line,f);
818  sprintf(line,"\t B Field\t\t = %10.2f G\n", info.magnetic_field);
819  fputs(line,f);
820  // add mean value of B field
821  sprintf(line, "\t Mean B field\t\t = %10.2f(%5.2f) G\n\n", odb.mean_bank.sample_b,
822  odb.mean_bank.var_sample_b);
823  fputs(line, f);
824 
825  for ( i=0; i<size; i++){
826  for ( j=0; j<5; j++){
827  if (strstr(odb.lemvac_settings.names_input[i], press[j])){
828  sprintf(line, "\t %s\t\t\t = %8.2e mbar\n", press[j], odb.lemvac_event.input[i]);
829  fputs(line, f);
830  }
831  }
832  }
833 
834  sprintf(line, "\n");
835  fputs(line,f);
836 
837  for ( i=0; i<size; i++){
838  for ( j=0; j<1; j++){
839  if (strstr(odb.moddy_settings.names_input[i], xtc[j])){
840  sprintf(line, "\t %s\t\t\t = %8.2f AA\n", xtc[j], odb.moddy_event.input[i]);
841  fputs(line, f);
842  }
843  }
844  }
845 
846  sprintf(line, "\t moderator\t\t = %s\n", info.moderator);
847  fputs(line,f);
848 
849  sprintf(line, "\t Date of Evaporation\t = %s\n\n", info.moderatorDATE);
850  fputs(line,f);
851 
852  sprintf(line, "\t Mirror horizontal\t = %6.2f degree\n", info.mirror.angle_horizontal);
853  fputs(line,f);
854  sprintf(line, "\t Mirror vertical\t = %6.2f mm\n", info.mirror.angle_vertical);
855  fputs(line,f);
856  sprintf(line, "\t Trigger horizontal\t = %6.2f degree\n", info.trigger.angle);
857  fputs(line,f);
858  sprintf(line, "\t Trigger vertical\t = %6.2f mm\n", info.trigger.height);
859  fputs(line,f);
860 
861  return SS_SUCCESS;
862 }
863 
864 /*--------------------*/
865 INT write_temp(FILE *f, BOOL running)
866 /* **********************\
867 \* **********************/
868 {
869  INT i, j, size;
870  const char *temp_mod[] = {"ModCryo_CF_1", "ModCryo_CF_2", "ModCryo_Chimney", "ModCryo_He_Shield"};
871  const char *temp_sample[] = {"Sample_CF1", "Sample_CF2", "Sample_D0"};
872 
873  size = sizeof(odb.moddy_event.input)/sizeof(float);
874 
875  sprintf(line, "\nTemperatures:\n");
876  fputs(line, f);
877  sprintf(line, "============\n");
878  fputs(line, f);
879 
880  for ( i=0; i<size; i++){
881  for ( j=0; j<4; j++){
882  if (strstr(odb.moddy_settings.names_input[i], temp_mod[j])){
883  sprintf(line, "\t %-15s\t = %8.2f K\n", temp_mod[j], odb.moddy_event.input[i]);
884  fputs(line, f);
885  }
886  }
887  }
888 
889  size = sizeof(odb.sample_event.input)/sizeof(float);
890  for ( i=0; i<size; i++){
891  for ( j=0; j<3; j++){
892  if (strstr(odb.sample_settings.names_input[i], temp_sample[j])){
893  sprintf(line, "\t %-15s\t = %8.2f K\n", temp_sample[j], odb.sample_event.input[i]);
894  fputs(line, f);
895  }
896  }
897  }
898  // add mean value of Sample
899  if (running)
900  sprintf(line, "\t Mean Sample\t\t = %8.2f(%5.2f) K", odb.mean_bank.sample_t,
901  odb.mean_bank.var_sample_t);
902  else{
903  for ( i=0; i<size; i++){
904  if (strstr(odb.sample_settings.names_input[i], temp_sample[0]))
905  sprintf(line, "\t Mean Sample\t\t = %8.2f(0.00) K", odb.sample_event.input[i]);
906  }
907  }
908  fputs(line, f);
909 
910  // add oven temperature, Omega controller
911  sprintf(line, "\n\t Oven_Omega_T1\t\t = %8.2f K", odb.oven_omega_event.input[0]);
912  fputs(line, f);
913 
914  sprintf(line, "\n");
915  fputs(line,f);
916 
917  return SS_SUCCESS;
918 }
919 
920 //---------------------------------------------------------------------
927 {
928  sprintf(line, "\nControl Room Scalers:\n");
929  fputs(line, f);
930  sprintf(line, "====================\n");
931  fputs(line, f);
932  sprintf(line, "\t Nominal Value = %d\n", info.controlroom_scaler_info.nominal_value);
933  fputs(line, f);
934  sprintf(line, "\t AHPOS Date = %s\n", info.controlroom_scaler_info.ahpos_date);
935  fputs(line, f);
936  sprintf(line, "\t Target = %s\n", info.controlroom_scaler_info.target);
937  fputs(line, f);
938  sprintf(line, "\n");
939  fputs(line,f);
940 }
941 
942 INT display_scaler(FILE *f)
943 /* ***************************************************************** *\
944 
945  Name: display_scaler
946  Author: Thomas Prokscha
947  Date: 28-May-2001
948 
949  Purpose: reads the scaler sum and rates from the ODB and
950  writes them at the end of the summary file.
951  Use void function disp_scaler in $MIDAS_WORK/src/scaler.c
952  as template.
953 
954  Input: FILE *f pointer to a file which already must be opened
955  in write mode.
956 
957  Output: None
958 
959 
960  Function value:
961  SS_SUCCESS Successful completion
962 
963 
964 \* ****************************************************************** */
965 {
966  double ssum[N_SCALER], rate, rate_perIp, bc_sum;
967 
968  INT scal_ch, ip_ch;
969  double scal_rate, norm, ip_norm, ip_rate, tdc_life;
970 
971  const char *state[] = {"", "Stopped", "Paused", "Running" };
972  const char *dashline[] =
973  {"--------------------------------------------------------------------------"};
974  const char *top[] =
975  {" # Label Total Rate/mAs Rate/s "};
976  time_t now, difftime;
977  INT i, size;
978 
979  /* for calculating the mean rates */
980  scal_ch = odb.scaler_param.channel_norm_time;
981  scal_rate = odb.scaler_param.rate_norm_time;
982  ip_ch = odb.scaler_param.ip_channel;
983  ip_rate = IpSCALE;
984 
985  sprintf(line, "\n%s\n", dashline[0]);
986  fputs(line, f);
987 
988  sprintf(line, " Run Number: %10d started at: %s\n",
989  odb.runinfo.run_number, odb.runinfo.start_time);
990  fputs(line, f);
991 
992  if ( odb.runinfo.state == STATE_STOPPED){
993  sprintf(line, " Run State : %10s last update: %s\n",
994  state[odb.runinfo.state], odb.runinfo.stop_time);
995  }
996  else{
997  time(&now);
998  sprintf(line, " Run State : %10s last update: %s\n",
999  state[odb.runinfo.state], ctime(&now));
1000  }
1001  fputs(line, f);
1002  sprintf(line, "\n%s\n", top[0]);
1003  fputs(line, f);
1004  sprintf(line, "%s\n\n", dashline[0]);
1005  fputs(line, f);
1006  db_find_key(hDB, 0, "/Equipment/Scaler/Variables/SSUM", &hKey);
1007  size = sizeof(ssum);
1008  db_get_data(hDB, hKey, &ssum, &size, TID_DOUBLE);
1009 
1010  for (i=0 ; i<N_SCALER ; i++){
1011  //if ( runinfo.state == STATE_STOPPED )
1012  //{
1013  if ( ssum[i] > 1e36 || (ssum[i] < 1e-36 && ssum[i] != 0.))
1014  ssum[i] = -1.; //something wrong in ODB
1015  norm = ssum[scal_ch]/scal_rate;
1016  ip_norm = ssum[ip_ch]/ip_rate;
1017  if ( norm > 0. )
1018  rate = ssum[i]/norm;
1019  else
1020  rate = -1.;
1021  if ( ip_norm > 0. )
1022  rate_perIp = ssum[i]/ip_norm;
1023  else
1024  rate_perIp = -1.;
1025 
1026  //}
1027  if ( ssum[i] > 1e7 )
1028  sprintf(line, "%2d %-12s %15.5e\t %13.1f %16.1f\n", i,
1029  odb.scaler_settings.names_scl0[i], ssum[i], rate_perIp, rate);
1030  else
1031  sprintf(line, "%2d %-12s %15.0f\t %13.1f %16.1f\n", i,
1032  odb.scaler_settings.names_scl0[i], ssum[i], rate_perIp, rate);
1033  fputs(line, f);
1034  }
1035  // sum 8 beam counter segments
1036  bc_sum = 0.;
1037  for ( i=BCL1; i<=BCR4; i++ ){
1038  bc_sum += ssum[i];
1039  }
1040  if ( norm > 0. )
1041  rate = bc_sum/norm;
1042  else
1043  rate = -1.;
1044  if ( ip_norm > 0. )
1045  rate_perIp = bc_sum/ip_norm;
1046  else
1047  rate_perIp = -1.;
1048 
1049  if ( bc_sum > 1e7 )
1050  sprintf(line, " BC-Sum: %20.5e\t %13.1f %16.1f\n", bc_sum, rate_perIp, rate);
1051  else
1052  sprintf(line, " BC-Sum: %20.0f\t %13.1f %16.1f\n", bc_sum, rate_perIp, rate);
1053  fputs(line, f);
1054 
1055  // vme statistics
1056  sprintf(line, "--- vme stats ----------\n");
1057  fputs(line, f);
1058 
1059  write_rates(f, norm, ip_norm, odb.vme_stats.slowMuonEvents, " SlowMuonEvents");
1060  write_rates(f, norm, ip_norm, odb.vme_stats.fastMuonEvents, " FastMuonEvents");
1061  write_rates(f, norm, ip_norm, odb.vme_stats.readcounts, " ReadMidasEvents");
1062  write_rates(f, norm, ip_norm, odb.vme_stats.td_clean, " TD-clean");
1063  write_rates(f, norm, ip_norm, odb.vme_stats.td_good, " TD-good");
1064  write_rates(f, norm, ip_norm, odb.vme_stats.mcp1_clean, " MCP1-clean");
1065  write_rates(f, norm, ip_norm, odb.vme_stats.mcp1_good, " MCP1-good");
1066  write_rates(f, norm, ip_norm, odb.vme_stats.mcp2_clean, " MCP2-clean");
1067  write_rates(f, norm, ip_norm, odb.vme_stats.mcp2_good, " MCP2-good");
1068 
1069  bc_sum = 0.;
1070  for ( i=BCL1; i<=BCR4; i++ ){
1071  bc_sum += odb.vme_stats.channelCounts[i];
1072  }
1073  write_rates(f, norm, ip_norm, bc_sum, " BC-Sum");
1074  write_rates(f, norm, ip_norm, odb.vme_stats.bc_clean, " BC-clean");
1075 
1076  //-------------------------------
1077  if ( ssum[CLOCK] > 0 )
1078  tdc_life = (double) odb.vme_stats.channelCounts[CLOCK] / ssum[CLOCK] * 100.;
1079  else
1080  tdc_life = -1.;
1081  sprintf(line, " TDC LifeTime: %17.2f(%) TDC Error counts: %15.0f\n", tdc_life, odb.vme_stats.tdc_error_counts);
1082  fputs(line,f);
1083 
1084  sprintf(line, " TDC Clock: %19.0f\n", odb.vme_stats.channelCounts[CLOCK]);
1085  fputs(line,f);
1086 
1087 
1088  sprintf(line, "%s\n", dashline[0]);
1089  fputs(line, f);
1090 
1091  if (odb.runinfo.state == STATE_STOPPED)
1092  difftime = odb.runinfo.stop_time_binary - odb.runinfo.start_time_binary;
1093  else
1094  difftime = now - odb.runinfo.start_time_binary;
1095 
1096  sprintf(line, "Elapsed time: %dh%02dm%02ds\n",
1097  difftime/3600, difftime%3600/60,difftime%60);
1098  fputs(line, f);
1099  sprintf(line, "\nRates are a v e r a g e d rates\n");
1100  fputs(line, f);
1101 
1102  return SS_SUCCESS;
1103 }
1104 /*-----------------------------------------------------------*/
1105 INT write_rates(FILE *f, double norm, double ip_norm, double scaler_sum, const char* label)
1106 /*
1107 
1108 */
1109 {
1110  double rate, rate_perIp;
1111 
1112  if ( norm > 0. )
1113  rate = scaler_sum / norm;
1114  else
1115  rate = -1.;
1116  if ( ip_norm > 0. )
1117  rate_perIp = scaler_sum / ip_norm;
1118  else
1119  rate_perIp = -1.;
1120 
1121  if ( scaler_sum > 1e7 )
1122  sprintf(line, "%-16s: %14.5e\t %13.1f %16.1f\n",
1123  label, scaler_sum, rate_perIp, rate);
1124  else
1125  sprintf(line, "%-16s: %14.0f\t %13.1f %16.1f\n",
1126  label, scaler_sum, rate_perIp, rate);
1127  fputs(line, f);
1128 
1129  return SS_SUCCESS;
1130 }
1131 /* ----------------------------------------------------------
1132 
1133  m a i n program
1134 
1135  ----------------------------------------------------------
1136 */
1137 main(int argc, char *argv[])
1138 {
1139  INT status, i, size;
1140  char host_name[HOST_NAME_LENGTH];
1141  char expt_name[HOST_NAME_LENGTH];
1142  char cmd[256];
1143  char printcmd[32];
1144 
1145  /* initialise */
1146  host_name[0] = 0;
1147  expt_name[0] = 0;
1148  cmd[0] = 0;
1149  printcmd[0] = 0;
1150 
1151  /* get default from environment variables */
1152  cm_get_environment (host_name, sizeof(host_name), expt_name, sizeof(expt_name));
1153 
1154  /* parse command line parameters */
1155  for ( i=1; i<argc; i++){
1156  if ( argv[i][0] == '-' ){
1157  if ( i+1 >= argc || argv[i+1][0] == '-' )
1158  goto usage;
1159  if ( argv[i][1] == 'e' )
1160  strcpy(expt_name, argv[i+1]);
1161  else if ( argv[i][1] == 'h' )
1162  strcpy(host_name, argv[i+1]);
1163  else{
1164 usage:
1165  printf("\n usage: write_summary [-h Hostname] [-e Experiment]\n\n");
1166  return 1;
1167  }
1168  }
1169  }
1170 
1171 /* ----------------
1172  connect to experiment expt_name on host host_name
1173  ----------------
1174 */
1175  status = cm_connect_experiment(host_name, expt_name, "write_summary", NULL);
1176  if ( status != CM_SUCCESS)
1177  return status;
1178 
1179 /* -----------------
1180  connect to ODB
1181  -----------------
1182 */
1183  cm_get_experiment_database(&hDB, NULL);
1184 
1185 /* ------------------
1186  open ODB records
1187  ------------------
1188 */
1189  ss_sleep(500);
1190  status = open_odb_records();
1191 
1192 /* -------------------------------------------------------
1193  do the run summary job if no odb error was encountered
1194  -------------------------------------------------------
1195 */
1196  if ( status == DB_SUCCESS ){
1199  sprintf(cmd, "emacs %s", sumfile);
1200  /* here we'll wait until emacs finishes */
1201 // system(cmd);
1202 
1203 /* ------------------
1204  send summary file to default printer ?
1205  only for Unix/Linux at the moment
1206  ------------------
1207 */
1208  size = sizeof(printcmd);
1209  if ( db_get_value(hDB, 0, "/Programs/print summary", &printcmd, &size, TID_STRING, FALSE)
1210  == DB_SUCCESS && odb.runinfo.state == 1 ){ /* print only when run is stopped */
1211 #ifdef OS_UNIX
1212  if ( strstr( printcmd, "print") ){
1213  sprintf(cmd, "%s %s &", printcmd, sumfile);
1214  system(cmd);
1215  }
1216 #endif
1217  }
1218  } /* if ( status == DB_SUCCESS ) */
1219 
1220  cm_disconnect_experiment();
1221 
1222 }
INT scaler_sum(EVENT_HEADER *, void *)
INT display_scaler(FILE *f)
float input[44]
Definition: experim.h:11083
float input[10]
Definition: experim.h:12864
float implantation_energy
Definition: nemu_experim.h:302
BOOL positrons_active
Definition: experim.h:664
int t0[N_DECAY_HISTS]
Definition: nemu_experim.h:323
double channelCounts[N_TDC_CHANNELS]
Definition: nemu_experim.h:104
UINT32 tof_bc_window
Definition: experim.h:694
float demand[40]
Definition: experim.h:1421
MODCRYO_EVENT moddy_event
float angle
Definition: nemu_experim.h:375
float moderator_hv
Definition: experim.h:1343
double slowMuonEvents
Definition: nemu_experim.h:101
#define BCR4
Definition: nemu_experim.h:25
char comment[80]
Definition: experim.h:658
#define N_FUG
float var_sample_hv
Definition: experim.h:1348
void write_control_room_scaler(FILE *f)
MODCRYO_SETTINGS moddy_settings
char target[132]
Definition: nemu_experim.h:390
char lem_setup[STR_SIZE]
Definition: nemu_experim.h:297
float var_moderator_hv
Definition: experim.h:1347
UINT32 tof_bc_pileup_window
Definition: experim.h:695
struct TRIGGER_SETTINGS::@20 event_2_settings
SAMPLECRYO_SETTINGS sample_settings
BEAMLINE_SETTINGS beamline_settings
INT32 rate_norm_time
Definition: experim.h:452
BOOL event_2_active
Definition: experim.h:661
char names[40][32]
Definition: experim.h:1527
FILE * file
float rotationangle
Definition: experim.h:176
BOOL event_1_active
Definition: experim.h:660
BOOL beamcounter_active
Definition: experim.h:665
char moderator[STR_SIZE]
Definition: nemu_experim.h:295
DANFYSIK_SPIN_ROT_EVENT danfysik_spin_rot_event
EXP_PARAM exp_param
double mcp1_good
Definition: nemu_experim.h:103
HV_DETECTORS_SETTINGS hvdet_settings
INT write_trigger(FILE *f)
UINT32 tof_m2_window
Definition: experim.h:680
float sample_b
Definition: experim.h:1346
struct INFO::@298 trigger
float angle_vertical
Definition: nemu_experim.h:372
float var_sample_b
Definition: experim.h:1350
float energy_loss
Definition: nemu_experim.h:301
INT32 mcp1_delay
Definition: experim.h:667
INT32 t0_offset
Definition: experim.h:692
void strcut(char *result, char *orgstr, char *cutstr)
float angle_horizontal
Definition: nemu_experim.h:371
OMEGA_EVENT oven_omega_event
float sample_t
Definition: experim.h:1345
struct INFO::@297 mirror
RUNINFO runinfo
char sample_name[128]
Definition: nemu_experim.h:298
char moderatorDATE[STR_SIZE]
Definition: nemu_experim.h:296
INT write_hvdet(FILE *f)
struct INFO::@294 t0_parameter
INT32 master_delay
Definition: experim.h:683
INT xtc(INT cmd,...)
float rotation_angle
Definition: nemu_experim.h:334
float measured[16]
Definition: experim.h:3915
#define BCL1
Definition: nemu_experim.h:18
BEAMLINE_EVENT beamline_event
char ahpos_date[132]
Definition: nemu_experim.h:389
INT create_sum_filename(char *filename, const char *flag)
INFO info
Definition: analyzer.cxx:94
char comment[136]
Definition: experim.h:27
INT write_eloss(FILE *f)
INT write_beamline(FILE *f)
struct TRIGGER_SETTINGS::@17 events
HV_SETTINGS hv_settings
struct TRIGGER_SETTINGS::@19 event_1_settings
TOFANAMODULE_PARAM tof_param
HV_EVENT hv_event
LEMVAC_SETTINGS lemvac_settings
struct INFO::@301 controlroom_scaler_info
char names_input[41][32]
Definition: experim.h:2155
INT write_env(FILE *f)
BOOL event_0_active
Definition: experim.h:659
INT write_temp(FILE *f, BOOL running)
float input[41]
Definition: experim.h:1895
double mcp2_good
Definition: nemu_experim.h:103
float sample_hv
Definition: experim.h:1344
INT32 td_delay
Definition: experim.h:689
char beamline_settings[132]
Definition: nemu_experim.h:304
SCALER_SETTINGS scaler_settings
void * podb
TRIGGER_SETTINGS trigger_settings
char names_scl0[64][32]
Definition: experim.h:1195
UINT32 data_window
Definition: experim.h:666
char line[MAXLINE]
char sample_cryo[NAME_LENGTH]
Definition: nemu_experim.h:299
INT write_sum_file(char *filename)
double td_clean
Definition: nemu_experim.h:102
ODB odb
double mcp2_clean
Definition: nemu_experim.h:102
BOOL mcp2_master
Definition: experim.h:676
main(int argc, char *argv[])
BOOL mcp2_active
Definition: experim.h:677
#define N_ELEMENTS
HNDLE hKey
double fastMuonEvents
Definition: nemu_experim.h:101
MEAN_BANK mean_bank
SAMPLECRYO_EVENT sample_event
char sumfile[256]
INT32 positron_delay
Definition: experim.h:668
float height
Definition: nemu_experim.h:376
double readcounts
Definition: nemu_experim.h:108
static INT rate[N_SCALER]
#define SPINROTATOR_VOLTAGE_CHANNEL
HV_DETECTORS_EVENT hvdet_event
float magnetic_field
Definition: nemu_experim.h:303
int nominal_value
Definition: nemu_experim.h:388
#define N_SCALER
total number of scaler channels
Definition: nemu_experim.h:63
double td_good
Definition: nemu_experim.h:103
double bc_clean
Definition: nemu_experim.h:102
#define IpSCALE
Definition: nemu_experim.h:79
float measured[40]
Definition: experim.h:1422
#define SPINROTATOR_CURRENT_CHANNEL
double mcp1_clean
Definition: nemu_experim.h:102
#define CLOCK
TDC channel assignments.
Definition: nemu_experim.h:15
struct INFO::@295 spinrot_parameter
float var_sample_t
Definition: experim.h:1349
double tdc_error_counts
Definition: nemu_experim.h:109
HNDLE hDB
float input[27]
Definition: experim.h:7409
INT write_t0(FILE *f)
INT32 channel_norm_time
Definition: experim.h:451
#define N_DECAY_HISTS
number of LE-uSR npp decay histograms
Definition: nemu_experim.h:71
#define MAXLINE
INT open_odb_records(void)
char names_input[30][32]
Definition: experim.h:3030
char names_input[27][32]
Definition: experim.h:7536
LEMVAC_EVENT lemvac_event
SCALERSUMRATE_PARAM scaler_param
INT write_hvtrans(FILE *f)
SCS2001M_EVENT scs2001m_event
const char * odbElements[]
struct TRIGGER_SETTINGS::@18 event_0_settings
VME_STATS vme_stats
INT write_rates(FILE *f, double norm, double ip_norm, double scaler_sum, const char *label)
UINT32 tof_m2_pileup_window
Definition: experim.h:681
char names[16][32]
Definition: experim.h:4413
float input[30]
Definition: experim.h:2660