scaler.c File Reference

Go to the source code of this file.

Functions

INT scaler_accum (EVENT_HEADER *, void *)
INT scaler_clear (INT run_number)
INT scaler_eor (INT run_number)

Variables

ANA_MODULE scaler_accum_module
double scaler [32]


Function Documentation

INT scaler_accum ( EVENT_HEADER ,
void *   
)

Definition at line 66 of file scaler.c.

00067 {
00068    INT n, i;
00069    DWORD *psclr;
00070    double *pacum;
00071 
00072    /* look for SCLR bank */
00073    n = bk_locate(pevent, "SCLR", &psclr);
00074    if (n == 0)
00075       return 1;
00076 
00077    /* create acummulated scaler bank */
00078    bk_create(pevent, "ACUM", TID_DOUBLE, &pacum);
00079 
00080    /* accumulate scalers */
00081    for (i = 0; i < n; i++) {
00082       scaler[i] += psclr[i];
00083       pacum[i] = scaler[i];
00084    }
00085 
00086    /* close bank */
00087    bk_close(pevent, pacum + n);
00088 
00089    return SUCCESS;
00090 }

INT scaler_clear ( INT  run_number  ) 

Definition at line 51 of file scaler.c.

00052 {
00053    memset(scaler, 0, sizeof(scaler));
00054    return SUCCESS;
00055 }

INT scaler_eor ( INT  run_number  ) 

Definition at line 59 of file scaler.c.

00060 {
00061    return SUCCESS;
00062 }


Variable Documentation

double scaler[32]

Definition at line 47 of file scaler.c.

Referenced by scaler_accum(), and scaler_clear().

ANA_MODULE scaler_accum_module

Initial value:

 {
   "Scaler accumulation",       
   "Stefan Ritt",               
   scaler_accum,                
   scaler_clear,                
   scaler_eor,                  
   NULL,                        
   NULL,                        
   NULL,                        
   0,                           
   NULL,                        
}

Definition at line 32 of file scaler.c.


Midas DOC Version 3.0.0 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Exaos Lee - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk