Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mc2coda.h File Reference

Go to the source code of this file.

Classes

struct  coda_crate_map
 
struct  coda_exp_info
 
struct  coda_event_info
 
struct  coda_hit_info
 

Macros

#define OK   0
 
#define ERROR   -1
 
#define MAX_PARAM   10
 
#define FADC250_MODE_RW   1 /* Raw Window */
 
#define FADC250_MODE_WI   2 /* Window Integrated */
 
#define FADC250_MODE_RP   3 /* Raw Pulse */
 
#define FADC250_MODE_IP   4 /* Integrated Pulse */
 
#define FADC125_MODE_RW   1
 
#define FADC125_MODE_WI   2
 
#define FADC125_MODE_RP   3
 
#define FADC125_MODE_IP   4
 
#define CAEN1190_MODE_TM   1 /* Trigger Matching mode */
 
#define CAEN1290_MODE_TM   1 /* Trigger Matching mode */
 
#define MAX_EXP   10
 
#define MAX_CRATES   128
 
#define MAX_SLOTS   21
 
#define MIN_SLOT   2
 
#define MAX_SLOT   21
 
#define MIN_TRIG_TIME   2048 /* minimum 8 microseconds for trigger time */
 
#define MAX_EVENT_SIZE   1048576 /* 1 Megabyte Default Event buffer size */
 
#define MAX_HIT_SIZE   256 /* Max Bytes for 1 Hit - eg RAW window mode for FADC250 */
 
#define MAX_TOTAL_HITS   50000 /* Define maximum number of hits that can be stored */
 
#define MAX_HITS_PER_SLOT   500 /* Max hits stored per slot (module) */
 
#define MAX_HITS_PER_CHAN   50 /* Max hits allowed per channel - most modules will less than this */
 
#define MC2CINIT_NULL   0
 
#define MC2CINIT_DEFINED   1
 
#define MC2CINIT_COMPLETE   2
 
#define ROC_BANK_OPEN(status, id, nevents)
 
#define ROC_BANK_CLOSE
 
#define DATA_BANK_OPEN(status, detid, nevents)
 
#define DATA_BANK_CLOSE
 

Typedefs

typedef struct coda_crate_map CODA_CRATE_MAP
 
typedef struct coda_exp_info CODA_EXP_INFO
 
typedef struct coda_event_info CODA_EVENT_INFO
 
typedef struct coda_hit_info CODA_HIT_INFO
 

Enumerations

enum  type_id_t {
  TID, FADC250, FADC125, F1TDC32,
  F1TDC48, JLAB_TS, TD, SSP,
  JLAB_DISC, MODULE_TYPE_RES1, MODULE_TYPE_RES2, MODULE_TYPE_RES3,
  MODULE_TYPE_RES4, MODULE_TYPE_RES5, MODULE_TYPE_RES6, MODULE_TYPE_RES7,
  UNKNOWN, VMECPU, CAEN1190, CAEN1290,
  N_MODULE_TYPES
}
 

Functions

void mc2codaSetRunNumber (unsigned int run_number)
 
CODA_EXP_INFOmc2codaInitExp (int nCrates, const char *name)
 
int mc2codaSetCrate (CODA_EXP_INFO *expID, int crateid, int nmod, int *modules, int *detid)
 
CODA_EVENT_INFOmc2codaOpenEvent (CODA_EXP_INFO *expID, uint64_t eventNum, uint64_t trigTime, unsigned short eventType, int maxSize)
 
int mc2codaWrite (CODA_EVENT_INFO *eventID, int nHits, struct coda_hit_info *codaHits)
 
void mc2codaStats (CODA_EVENT_INFO *eventID, int sflag)
 
unsigned int mc2codaCloseEvent (CODA_EVENT_INFO *eventID)
 
int mc2codaResetEvent (CODA_EVENT_INFO *eventID, uint64_t eventNum, uint64_t trigTime, unsigned short eventType)
 
int mc2codaFreeEvent (CODA_EVENT_INFO *eventID)
 
void mc2codaFree (CODA_EXP_INFO *expID)
 

Macro Definition Documentation

#define CAEN1190_MODE_TM   1 /* Trigger Matching mode */

Definition at line 59 of file mc2coda.h.

#define CAEN1290_MODE_TM   1 /* Trigger Matching mode */

Definition at line 61 of file mc2coda.h.

#define DATA_BANK_CLOSE
Value:
*StartOfBank = (uint32_t) (dabufp - StartOfBank - 1); \
} \
static unsigned int * dabufp
Definition: mc2coda.c:23

Definition at line 150 of file mc2coda.h.

Referenced by WriteDAQconfigBank().

#define DATA_BANK_OPEN (   status,
  detid,
  nevents 
)
Value:
{ \
uint32_t *StartOfBank; \
StartOfBank = dabufp; \
*(++dabufp) = (((status) << 28) | (detid) << 16) | 0x0100 | (nevents);\
(dabufp)++;
static unsigned int * dabufp
Definition: mc2coda.c:23

Definition at line 144 of file mc2coda.h.

Referenced by WriteDAQconfigBank().

#define ERROR   -1

Definition at line 7 of file mc2coda.h.

Referenced by mc2codaFreeEvent().

#define FADC125_MODE_IP   4

Definition at line 54 of file mc2coda.h.

Referenced by JEventProcessor_rawevent::evnt(), and mc2codaCloseEvent().

#define FADC125_MODE_RP   3

Definition at line 53 of file mc2coda.h.

#define FADC125_MODE_RW   1

Definition at line 51 of file mc2coda.h.

#define FADC125_MODE_WI   2

Definition at line 52 of file mc2coda.h.

#define FADC250_MODE_IP   4 /* Integrated Pulse */

Definition at line 49 of file mc2coda.h.

Referenced by JEventProcessor_rawevent::evnt(), and mc2codaCloseEvent().

#define FADC250_MODE_RP   3 /* Raw Pulse */

Definition at line 48 of file mc2coda.h.

#define FADC250_MODE_RW   1 /* Raw Window */

Definition at line 46 of file mc2coda.h.

#define FADC250_MODE_WI   2 /* Window Integrated */

Definition at line 47 of file mc2coda.h.

#define MAX_CRATES   128

Definition at line 68 of file mc2coda.h.

Referenced by mc2codaInitExp(), and mc2codaStats().

#define MAX_EVENT_SIZE   1048576 /* 1 Megabyte Default Event buffer size */

Definition at line 75 of file mc2coda.h.

Referenced by mc2codaOpenEvent().

#define MAX_EXP   10

Definition at line 67 of file mc2coda.h.

#define MAX_HIT_SIZE   256 /* Max Bytes for 1 Hit - eg RAW window mode for FADC250 */

Definition at line 76 of file mc2coda.h.

#define MAX_HITS_PER_CHAN   50 /* Max hits allowed per channel - most modules will less than this */
#define MAX_HITS_PER_SLOT   500 /* Max hits stored per slot (module) */

Definition at line 78 of file mc2coda.h.

Referenced by mc2codaOpenEvent(), and mc2codaWrite().

#define MAX_PARAM   10

Definition at line 9 of file mc2coda.h.

#define MAX_SLOT   21

Definition at line 71 of file mc2coda.h.

#define MAX_TOTAL_HITS   50000 /* Define maximum number of hits that can be stored */

Definition at line 77 of file mc2coda.h.

#define MC2CINIT_COMPLETE   2

Definition at line 83 of file mc2coda.h.

Referenced by mc2codaSetCrate().

#define MC2CINIT_DEFINED   1

Definition at line 82 of file mc2coda.h.

Referenced by mc2codaInitExp().

#define MC2CINIT_NULL   0

Definition at line 81 of file mc2coda.h.

Referenced by mc2codaFree().

#define MIN_SLOT   2

Definition at line 70 of file mc2coda.h.

#define MIN_TRIG_TIME   2048 /* minimum 8 microseconds for trigger time */

Definition at line 73 of file mc2coda.h.

#define OK   0

Definition at line 6 of file mc2coda.h.

#define ROC_BANK_CLOSE
Value:
*StartOfRocBank = (uint32_t) (dabufp - StartOfRocBank -1); \
} \
static unsigned int * StartOfRocBank
Definition: mc2coda.c:23
static unsigned int * dabufp
Definition: mc2coda.c:23

Definition at line 139 of file mc2coda.h.

Referenced by mc2codaCloseEvent().

#define ROC_BANK_OPEN (   status,
  id,
  nevents 
)
Value:
{ \
*(++dabufp) = (((status) << 28) | (id) << 16) | 0x1000 | (nevents);\
(dabufp)++;
static unsigned int * StartOfRocBank
Definition: mc2coda.c:23
static unsigned int * dabufp
Definition: mc2coda.c:23

Definition at line 134 of file mc2coda.h.

Referenced by mc2codaCloseEvent().

Typedef Documentation

typedef struct coda_exp_info CODA_EXP_INFO
typedef struct coda_hit_info CODA_HIT_INFO

Enumeration Type Documentation

enum type_id_t
Enumerator
TID 
FADC250 
FADC125 
F1TDC32 
F1TDC48 
JLAB_TS 
TD 
SSP 
JLAB_DISC 
MODULE_TYPE_RES1 
MODULE_TYPE_RES2 
MODULE_TYPE_RES3 
MODULE_TYPE_RES4 
MODULE_TYPE_RES5 
MODULE_TYPE_RES6 
MODULE_TYPE_RES7 
UNKNOWN 
VMECPU 
CAEN1190 
CAEN1290 
N_MODULE_TYPES 

Definition at line 14 of file mc2coda.h.

Function Documentation

int mc2codaSetCrate ( CODA_EXP_INFO expID,
int  crateid,
int  nmod,
int *  modules,
int *  detid 
)
void mc2codaSetRunNumber ( unsigned int  run_number)

Definition at line 34 of file mc2coda.c.

References RUN_NUMBER.

Referenced by JEventProcessor_rawevent::brun().