Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
hycal.h
Go to the documentation of this file.
1 #ifndef _HYCAL_H_
2 #define _HYCAL_H_
3 
4 #define MSECT 5
5 #define MCOL 12
6 #define MROW 12
7 
8 // #define READ_MC_FILE
9 
10 #ifdef READ_MC_FILE
11 #define ADMIX_CLOCK // Whether to admix clock-ev. pattern to mc
12 #define HEGEN(N) read_mcfile_com_.hegen[N-1]
13 #endif
14 
15 #define CRYSTAL_BLOCKS 144 // 12x12 array (2x2 hole in the center)
16 #define T_BLOCKS 144
17 
18 #define MAX_HHITS 144 // For Hycal
19 #define MAX_CLUSTERS 60 // 1728/2 ?
20 #define MAX_CC 60 // Maximum Cluster Cells per cluster
21 
22 #define nint_phot_cell 5
23 #define ncoef_phot_cell 3
24 #define dcorr_phot_cell 16
25 
26 extern int status_global[MSECT][MCOL][MROW];
27 
28 extern float Nonlin_en1[T_BLOCKS]; // Hycal nonlin: term1
29 extern float Nonlin_en2[T_BLOCKS]; // Hycal nonlin: term2
30 extern int event_num;
31 extern int run_num;
32 extern int clock_num;
33 extern float beam_energy;
34 extern float tac_energy;
35 extern float beam_time;
36 extern int n_h_clusters;
37 extern int n_h_hits;
38 extern int tagger_id;
39 extern int tagger_time;
40 extern int iftac;
41 
42 typedef struct {
43  int id; // ID of block
44  float x; // Center of block x-coord
45  float y; // Center of block y-coord
46 // int cc; // Number of ClusterMembers including central member
47 // int member[MAX_CC]; // Array of ints to hold the ClusterMembers
48  int sector; // 0 for W, 1 - 4 for Glass (clockwise starting at noon)
49  int row; // row number within sector
50  int col; // column number within sector
51 } blockINFO_t;
52 
54 
55 #define CRYS_ROWS 12
56 #define CRYS_SIZE_X 2.077 // real X-size of crystal
57 #define CRYS_SIZE_Y 2.075 // real Y-size of crystal
58 
59 typedef struct {
60  int id[MAX_CC]; // ID of ith block, where i runs from 0 to 8
61  float E[MAX_CC]; // Energy of ith block
62  float x[MAX_CC]; // Center of ith block x-coord
63  float y[MAX_CC]; // Center of ith block y-coord
64  float t[MAX_CC];
65 } cluster_t;
66 /*----- start of ccalcluster bank -----*/
67 /* ccalcluster: CCAL cluster bank */
68 
69 typedef struct {
70  int type; /* cluster types: 0,1,2,3,4;-1 */
71  int nhits; /* Number of hits in cluster */
72  int id; /* Cluster's central cell's ID */
73  float E; /* Cluster's energy (GeV) */
74  float E1; /* Cluster's energy (GeV) */
75  float E2; /* Cluster's energy (GeV) */
76  float time; /* Cluster's time (ns) */
77  float x; /* Cluster's x-position (cm) */
78  float y; /* Cluster's y-position (cm) */
79  float chi2; /* Cluster's profile fit to single shower profile */
80  float x1; /* Cluster's x1-position (cm) */
81  float y1; /* Cluster's y1-position (cm) */
82  float sigma_E;
83  float emax;
84  int status;
86 
87 typedef struct {
88  int id; // ID of ADC
89  float e; // Energy of ADC
90 } ccalhit_t;
91 
92 extern ccalhit_t ccalhit[T_BLOCKS];
95 
96 float energy_correct(float c_energy, int central_id);
97 float shower_depth(float energy);
98 int IsIDinVec( vector< const DCCALHit* > hitarray, int id12 );
99 
100 extern "C" void main_island_();
101 
102 extern "C" void init_island_(char filename[1000], int *name_length);
103 //extern "C" void init_island_(float new_acell[2][501][501], float new_ad2c[2][501][501]);
104 
105 extern "C" {extern struct {int mcrun, mcevent; float hegen[64];
107 extern "C" {extern struct {int mcread_flag, mc_eof_flag, nreadmc;} mcread_stat_com_;}
108 
109 #define ECH(M,N) ech_common_.ech[N-1][M-1]
110 extern "C" {extern struct {int ech[MROW][MCOL];} ech_common_;}
111 //#define TIME(M,N) tch_common_.time[N-1][M-1]
112 //extern "C" {extern struct {int time[MROW][MCOL];} tch_common_;}
113 #define STAT_CH(M,N) stat_ch_common_.stat_ch[N-1][M-1]
114 extern "C" {extern struct {int stat_ch[MROW][MCOL];} stat_ch_common_;}
115 
116 #define ICL_INDEX(M,N) icl_common_.icl_index[N][M]
117 #define ICL_IENER(M,N) icl_common_.icl_iener[N][M]
118 extern "C" {extern struct {int icl_index[MAX_CC][200], icl_iener[MAX_CC][200];} icl_common_;}
119 
120 #define HEGEN(N) read_mcfile_com_.hegen[N-1]
121 
122 #define SET_XSIZE set_common_.xsize
123 #define SET_YSIZE set_common_.ysize
124 #define SET_EMIN set_common_.mine
125 #define SET_EMAX set_common_.maxe
126 #define SET_HMIN set_common_.min_dime
127 #define SET_MINM set_common_.minm
128 #define NCOL set_common_.ncol
129 #define NROW set_common_.nrow
130 #define ZHYCAL set_common_.zhycal
131 #define ISECT set_common_.isect
132 
133 extern "C" {extern struct {float xsize, ysize, mine, maxe; int min_dime; float minm;
134  int ncol, nrow; float zhycal; int isect;} set_common_;}
135 
136 extern "C" {extern struct {int nadcgam;
137  union {int iadcgam[50][12]; float fadcgam[50][12];} u;} adcgam_cbk_;}
138 
139 extern "C" {extern struct {float fa[100];} hbk_common_;}
140 #define FA(N) hbk_common_.fa[N-1]
141 
142 #endif
int nout
Definition: hycal.h:106
float E2
Definition: hycal.h:75
float maxe
Definition: hycal.h:133
float fa[100]
Definition: hycal.h:139
int iadcgam[50][12]
Definition: hycal.h:137
struct @5 set_common_
void main_island_()
int col
Definition: hycal.h:50
#define T_BLOCKS
Definition: hycal.h:16
int iout[MAX_HHITS]
Definition: hycal.h:106
int id
Definition: hycal.h:72
int IsIDinVec(vector< const DCCALHit * > hitarray, int id12)
float energy_correct(float c_energy, int central_id)
float beam_time
Double_t x[NCHANNELS]
Definition: st_tw_resols.C:39
float Nonlin_en2[T_BLOCKS]
int sector
Definition: hycal.h:48
ccalhit_t ccalhit[T_BLOCKS]
TString filename
#define y
float E1
Definition: hycal.h:74
struct @1 mcread_stat_com_
struct @6 adcgam_cbk_
struct @0 read_mcfile_com_
int nreadmc
Definition: hycal.h:107
int event_num
int icl_iener[MAX_CC][200]
Definition: hycal.h:118
float x
Definition: hycal.h:77
int nadcgam
Definition: hycal.h:136
#define MROW
Definition: hycal.h:6
#define MSECT
Definition: hycal.h:4
int ncol
Definition: hycal.h:134
#define MCOL
Definition: hycal.h:5
int mcevent
Definition: hycal.h:105
float e
Definition: hycal.h:89
float x1
Definition: hycal.h:80
float emax
Definition: hycal.h:83
float Nonlin_en1[T_BLOCKS]
int icl_index[MAX_CC][200]
Definition: hycal.h:118
float fadcgam[50][12]
Definition: hycal.h:137
int iftac
int nrow
Definition: hycal.h:134
float shower_depth(float energy)
float hegen[64]
Definition: hycal.h:105
int id
Definition: hycal.h:88
float ysize
Definition: hycal.h:133
int row
Definition: hycal.h:49
int id
Definition: hycal.h:43
float zhycal
Definition: hycal.h:134
int n_h_hits
float mine
Definition: hycal.h:133
int mcrun
Definition: hycal.h:105
#define MAX_CLUSTERS
Definition: hycal.h:19
int stat_ch[MROW][MCOL]
Definition: hycal.h:114
struct @2 ech_common_
cluster_t cluster_storage[MAX_CLUSTERS]
float beam_energy
struct @3 stat_ch_common_
int tagger_id
struct @4 icl_common_
int aout[MAX_HHITS]
Definition: hycal.h:106
int tagger_time
float sigma_E
Definition: hycal.h:82
float y1
Definition: hycal.h:81
int mc_eof_flag
Definition: hycal.h:107
float y
Definition: hycal.h:78
struct @7 hbk_common_
#define MAX_HHITS
Definition: hycal.h:18
int type
Definition: hycal.h:70
float chi2
Definition: hycal.h:79
float y
Definition: hycal.h:45
int clock_num
float xsize
Definition: hycal.h:133
int status
Definition: hycal.h:84
float E
Definition: hycal.h:73
float time
Definition: hycal.h:76
float minm
Definition: hycal.h:133
int nhits
Definition: hycal.h:71
float tac_energy
float x
Definition: hycal.h:44
int n_h_clusters
ccalcluster_t ccalcluster[MAX_CLUSTERS]
int ech[MROW][MCOL]
Definition: hycal.h:110
int mcread_flag
Definition: hycal.h:107
int run_num
#define MAX_CC
Definition: hycal.h:20
blockINFO_t blockINFO[T_BLOCKS]
int min_dime
Definition: hycal.h:133
int isect
Definition: hycal.h:134
union @6::@8 u
int status_global[MSECT][MCOL][MROW]
void init_island_(char filename[1000], int *name_length)