StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Tonko2Ezt.cxx
1 // $Id: Tonko2Ezt.cxx,v 1.6 2009/05/26 08:45:12 ogrebeny Exp $
2 #include <stdio.h>
3 #include <assert.h>
4 #include <string.h>
5 #include <stdlib.h>
6 #include <iostream>
7 using namespace std;
8 
9 #include <TObjArray.h>
10 
11 #include "Tonko2Ezt.h"
12 
13 #ifndef NEW_DAQ_READER
14 # include "evpReader.hh"
15 # include "emcReader.h"
16 #else
17 # include "DAQ_READER/daqReader.h"
18 # include "DAQ_READER/daq_dta.h"
19 # include "DAQ_EMC/daq_emc.h"
20 # include "DAQ_ETOW/daq_etow.h"
21 # include "DAQ_ESMD/daq_esmd.h"
22 #endif
23 
24 //-------------------------------------------
25 //-------------------------------------------
26 Tonko2Ezt::Tonko2Ezt(char *rdrc) {
27  eETowPresent = false;
28  eESmdPresent = false;
29 #ifdef NEW_DAQ_READER
30  daqReader *rdr = (daqReader*)(rdrc);
31 #endif
32 
33 #ifdef NEW_DAQ_READER
34  daq_dta *dd_etow = rdr ? (rdr->det("etow")->get("adc")) : 0;
35  if (dd_etow) while (dd_etow->iterate()) {
36  etow_t *d = (etow_t *) dd_etow->Void;
37  if (d) {
38 #else
39  if (emc.etow_in) {
40  {
41 #endif
42  for(int ib = 0;ib < ETOW_MAXFEE;ib++) {
43  eETow.createBank(ib,ETOW_PRESIZE,ETOW_DATSIZE);
44 #ifdef NEW_DAQ_READER
45  eETow.setHeader(ib,(unsigned short*)&(d->preamble[ib][0]));
46  eETow.setData(ib,(unsigned short*)&(d->adc[ib][0]));
47 #else
48  eETow.setHeader(ib,emc.etow_pre[ib]);
49  eETow.setData(ib,emc.etow[ib]);
50 #endif
51  eETowPresent = true;
52  }
53  }
54  }
55 #ifdef NEW_DAQ_READER
56  daq_dta *dd_esmd = rdr ? (rdr->det("esmd")->get("adc")) : 0;
57  if (dd_esmd) while (dd_esmd->iterate()) {
58  esmd_t *d = (esmd_t *) dd_esmd->Void;
59  if (d) {
60 #else
61  if (emc.esmd_in) {
62  {
63 #endif
64  for(int ib = 0;ib < ESMD_MAXFEE;ib++) {
65  eESmd.createBank(ib,ESMD_PRESIZE,ESMD_DATSIZE);
66 #ifdef NEW_DAQ_READER
67  eESmd.setHeader(ib,(unsigned short*)&(d->preamble[ib][0]));
68  eESmd.setData(ib,(unsigned short*)&(d->adc[ib][0]));
69 #else
70  eESmd.setHeader(ib,emc.esmd_pre[ib]);
71  eESmd.setData(ib,emc.esmd[ib]);
72 #endif
73  eESmdPresent = true;
74  //eESmd.print(ib,0);
75  //printf("%x %x %x %x \n", emc.esmd_pre[ib][0], emc.esmd_pre[ib][1], emc.esmd_pre[ib][2], emc.esmd_pre[ib][3]);
76  }
77  }
78  }
79 }
80 
81 // $Log: Tonko2Ezt.cxx,v $
82 // Revision 1.6 2009/05/26 08:45:12 ogrebeny
83 // Bug fix to disable EEMC plots if the detector is not in the run
84 //
85 // Revision 1.5 2009/01/24 03:47:43 ogrebeny
86 // Fuxed bug - can see ETOW data now
87 //
88 // Revision 1.4 2009/01/24 01:14:35 ogrebeny
89 // Now uses new DAQ reader
90 //
91 // Revision 1.3 2009/01/13 16:31:05 fine
92 // Add StEEmcPool package to the daqReader dependants
93 //
94 // Revision 1.2 2008/12/19 17:59:27 fine
95 // Add NEW_DAQ_READER flag
96 //
97 // Revision 1.1 2005/04/28 20:54:47 balewski
98 // start
99 //
100 
101 
Definition: daq_etow.h:9
u_short esmd_pre[ESMD_MAXFEE][ESMD_PRESIZE]
ADC data.
Definition: daq_emc.h:95