src/common/MUnCompressRawData.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <endian.h>
#include <byteswap.h>
#include <time.h>
#include "midas.h"
#include "mucap_compress.h"
#include "common.h"

Go to the source code of this file.

Functions

INT MUnCompressRawData_init (void)
INT MUnCompressRawData (EVENT_HEADER *, void *)

Variables

HNDLE hDB
ANA_MODULE MUnCompressRawData_module

Function Documentation

INT MUnCompressRawData ( EVENT_HEADER *  pheader,
void *  pevent 
)

Definition at line 67 of file MUnCompressRawData.cpp.

00068 {
00069   int event_id = pheader->event_id;
00070 
00071   int event_serial = pheader->serial_number;
00072   
00073   // *** modified by VT on 9-Oct-2008 ***
00074   //int skip_threshold = 40;
00075   int skip_threshold = 1;
00076   if (event_serial % skip_threshold !=0){
00077     printf("Event is not divisible by %d, no analysis will be done\n",skip_threshold);
00078     return ANA_SKIP;
00079   }
00080   time_t block_time = pheader->time_stamp;
00081   char fdate[] = "%Y-%m-%d", ftime[] = "%H:%M:%S";
00082   struct tm block_tm;
00083   localtime_r(&block_time, &block_tm);
00084   char sdate[100], stime[100];
00085   strftime(sdate, 100, fdate, &block_tm);
00086   strftime(stime, 100, ftime, &block_tm);
00087   //  printf("Current block (serial number %d) stored on %s at %s\n", 
00088   //     event_serial, sdate, stime);
00089 
00090   if (event_id == EVENTID_BOR || 
00091       event_id == EVENTID_EOR ||
00092       event_id == EVENTID_MESSAGE) {
00093       
00094     // No decompression is necessary for non-ordinary events
00095 
00096   } else {
00097 
00098     expand_event(pevent, pevent);
00099 
00100   }
00101 
00102   return SUCCESS;
00103 }

INT MUnCompressRawData_init ( void   ) 

Definition at line 58 of file MUnCompressRawData.cpp.

00059 {
00060   compress_load_all();
00061 
00062   return SUCCESS;
00063 }


Variable Documentation

HNDLE hDB
Initial value:
 {
  "MUnCompressRawData",          
  "Tom Banks",                 
  MUnCompressRawData,          
  NULL,                          
  NULL,                        
  MUnCompressRawData_init,     
  NULL,                        
  NULL,                        
  0,                           
  NULL,                        
}

Definition at line 43 of file MUnCompressRawData.cpp.


Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1