MIDAS
Loading...
Searching...
No Matches
template.c File Reference
#include <stdio.h>
#include "midas.h"
#include "exprim.h"
Include dependency graph for template.c:

Go to the source code of this file.

Functions

 INT< template > (EVENT_HEADER *, void *)
 
INT< template_init (void)
 
< TEMPLATE_PARAM_STR (< template > _param_str)
 

Variables

< TEMPLATE > _PARAM< template_param
 
ANA_MODULE< template_module
 

Function Documentation

◆ _init()

INT< template > _init ( void  )

Definition at line 97 of file template.c.

98{
99 /* book histos */
100
101 return SUCCESS;
102}
#define SUCCESS
Definition mcstd.h:54

◆ _PARAM_STR()

< TEMPLATE > _PARAM_STR ( < template _param_str)

◆ INT< template >()

INT< template > ( EVENT_HEADER pheader,
void pevent 
)

Definition at line 97 of file template.c.

106 {
107 int n;
110
111 /* look for <XXXX> bank, return if not present */
112 n = bk_locate(pevent, "XXXX", &xxxx);
113 if (n == 0)
114 return SUCCESS;
115
116 /* create calculated bank */
117 bk_create(pevent, "YYYY", TID_STRUCT, &yyyy);
118
119 /*---- perform calculations --------------------------------------*/
120
121 yyyy->x = xxxx->x * 2;
122
123 /*---- close calculated bank -------------------------------------*/
124 bk_close(pevent, yyyy + 1);
125
126 return SUCCESS;
127}
INT bk_close(void *event, void *pdata)
Definition midas.cxx:16780
INT bk_locate(const void *event, const char *name, void *pdata)
Definition midas.cxx:16889
void bk_create(void *event, const char *name, WORD type, void **pdata)
Definition midas.cxx:16561
#define TID_STRUCT
Definition midas.h:348
DWORD n[4]
Definition mana.cxx:247
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24

Variable Documentation

◆ _module

ANA_MODULE< template > _module
Initial value:
= {
"<template>",
"<Your Name>",
<template >,
NULL,
NULL,
<template > _init,
NULL,
&<template > _param,
sizeof(<template > _param),
<template > _param_str,
}
INT< template > _init(void)
Definition template.c:97
< TEMPLATE > _PARAM< template > _param
Definition template.c:70

Definition at line 82 of file template.c.

82 {
83 "<template>", /* module name */
84 "<Your Name>", /* author */
85 <template >, /* event routine */
86 NULL, /* BOR routine */
87 NULL, /* EOR routine */
88 <template > _init, /* init routine */
89 NULL, /* exit routine */
90 &<template > _param, /* parameter structure */
91 sizeof(<template > _param), /* structure size */
92 <template > _param_str, /* initial parameters */
93};

◆ _param

< TEMPLATE > _PARAM< template > _param

Definition at line 70 of file template.c.