Subversion Repositories f9daq

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
264 f9daq 1
#ifndef _daq_h_
2
#define _daq_h_
3
 
4
#define MAXCH 64
5
#define MAXPMT 16
6
 
7
#define NSTEPS 4790 // en krog je 4790 korakov   
8
 
9
typedef struct  {
10
        float x[3];
11
} HVector3;
12
 
13
struct Module {
14
        double r;
15
        double phi;
16
};
17
 
18
 
19
 
20
struct Channel {
21
        int ix;
22
        int iy;
23
};
24
 
25
 
26
struct Config {
27
        int nofcrystalsx;
28
        int nofcrystalsy;
29
        double crystalpitchx;
30
        double crystalpitchy;
31
        char *modules;
32
        char *channels;
33
        char *sumpedestals;
34
        char *pedestals;
35
        char *photopeak;
36
        char *channelcalibration;
37
        int adcthreshold;
38
        double peakscaling;
39
        struct Module module[16];
40
        struct Channel channel[16];
41
        float apedestals[MAXCH];
42
        float apeak[MAXCH];
43
        float rotation;
44
        int write;
45
        int coincidences;  // stevilo koincidenc
46
} conf;
47
 
48
 
49
 
50
#define NUM_CHANNELS    1
51
#define PEDESTAL                        255
52
#define SCAN_TYPE                       1
53
 
54
#define RUNREC_ID                       1
55
#define ENDREC_ID                       2
56
#define POSREC_ID                       3
57
#define EVTREC_ID                       4
58
 
59
typedef struct {
60
        unsigned int id,length;
61
        unsigned int fver,time;
62
        unsigned int num_events,num_channels,pedestal,xy;
63
        int nx,x0,dx,ny,y0,dy;
64
} RUNREC;
65
typedef struct {
66
        unsigned int id,length;
67
        unsigned int time,dum;
68
} ENDREC;
69
 
70
typedef struct {
71
        unsigned int id,length;
72
        unsigned int time;
73
        int num_iter_x,mikro_pos_x,set_pos_x;
74
        int num_iter_y,mikro_pos_y,set_pos_y;
75
} POSREC;
76
 
77
int debug;
78
int fPedestal;
79
int fThresholdEnable;
80
int fStop;
81
int fMode;
82
int clear();
83
int end();
84
int event(unsigned int *, int,int *, int );
85
int init();
86
int vmconnect();
87
int vmdisconnect();
88
int vmacquire (int neve,FILE *fp, char *fpedname);
89
 
90
 
91
int HistogramsInit();
92
int HistogramsFill();
93
int HistogramsWrite(const char *fname);
94
int  GetGlobalPosition(int ipmt, double angle, float cx, float cy, float *gposition);
95
int analyse(int nb, uint32_t *data);
96
 
97
 
98
//-----------------
99
 
100
int m_Adc[MAXCH];
101
int m_AdcCut[MAXCH];
102
int m_Adc_vs_Nhits[MAXCH];
103
int m_Adc_vs_Sum[MAXCH];
104
int m_Adc_vs_Sum_Uncorected[MAXCH];
105
int m_Nhits;
106
int m_AdcSum[MAXPMT];
107
int m_CenterOfGravity[MAXPMT];
108
int m_ReconstructedPosition[MAXPMT];
109
int m_CenterOfGravityforChAboveThreshold[MAXPMT];
110
int m_GlobalPosition;
111
int m_AdcSumCluster[MAXPMT];
112
int m_MaxAdc[MAXPMT];
113
int m_SumAdc[MAXPMT];
114
 
115
//-----------------
116
 
117
#endif