StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEMCReader.cxx
1 /***************************************************************************
2  *
3  *
4  *
5  * Author: Herbert Ward and Subhasis C.
6  ***************************************************************************
7  *
8  * Description: Offline Wrapper for DAQ EMC reader classes
9  *
10  ***************************************************************************
11  *
12  *
13  *
14  **************************************************************************/
15 #include <string.h>
16 #include <stdio.h>
17 #include <errno.h>
18 #include <assert.h>
19 
20 #include "StDAQReader.h"
21 #include "StEMCReader.h"
22 #include "StDaqLib/EMC/EMC_Reader.hh"
23 
24 typedef EventInfo DAQEventInfo;
25 
26 StEMCReader::StEMCReader(StDAQReader *daqr) {
27  fEMCImpReader=0;
28  fDAQReader = daqr;
29  delete fEMCImpReader;
30  fEMCImpReader = ::getEMCReader(daqr->getEventReader());
31 
32  /*
33  if(fEMCImpReader){
34  Int_t towerfill=FillTowerArray();
35  if(towerfill!=kStOK)printf("tower arrays are not filled)"
36  Int_t prsfill=FillPRSArray();
37  if(prsfill!=kStOK)printf("PRS arrays are not filled)"
38  Int_t smdefill=FillSMDEArray();
39  if(towerfill!=kStOK)printf("SMDE arrays are not filled)"
40  Int_t towerfill=FillSMDPArray();
41  if(towerfill!=kStOK)printf("SMDP arrays are not filled)"
42 }
43  */
44 }
45 
46 
47 StEMCReader::~StEMCReader() {
48 }
49 
50 int StEMCReader::close() {
51 // delete fEMCImpReader; fEMCImpReader=0;
52  return 1;
53 }
54 
55 int StEMCReader::Update() {
56  delete fEMCImpReader;
57  fEMCImpReader = ::getEMCReader(fDAQReader->getEventReader());
58  // close();
59  cout<<" EMC Updated**"<<endl;
60  return 1;
61 }
62 
63 int StEMCReader::getTowerADC(int mod,int e, int s,unsigned short& ADC )
64  {
65 
66  if(!fEMCImpReader->getTowerADC(mod,e,s,ADC))return 0;
67  return 1; //1 is good
68  }
69 int StEMCReader::getTowerADC(int index,unsigned short& ADC )
70  {
71 
72  if(!fEMCImpReader->getTowerADC(index,ADC))return 0;
73  return 1; //1 is good
74  }
75 
76 int StEMCReader::getSMDE_ADC(int mod,int e,unsigned short& ADC )
77  {
78 
79  if(!fEMCImpReader->getSMDE_ADC(mod,e,ADC))return 0;
80  return 1; //1 is good
81  }
82 
83 int StEMCReader::getSMDP_ADC(int mod,int bin,int s,unsigned short& ADC )
84  {
85 
86  if(!fEMCImpReader->getSMDP_ADC(mod,bin,s,ADC))return 0;
87  return 1; //1 is good
88  }
89 
90 int StEMCReader::getSMD_TIMEBIN(int fiber,unsigned int& TimeBin )
91  {
92  if(!fEMCImpReader->getSMD_TIMEBIN(fiber,TimeBin))return 0;
93  return 1; //1 is good
94  }
95 
96 int StEMCReader::getSMD_ADC(int index,int fiber,unsigned short& ADC )
97  {
98 
99  if(!fEMCImpReader->getSMD_ADC(index,fiber,ADC))return 0;
100  return 1; //1 is good
101  }
102 
103 /*
104 int StEMCReader::getTowerADCR(int mod,unsigned short*** & AdcList)
105  {
106 
107  if(!fEMCImpReader->getTowerADCR(&AdcList[mod-1]))return 0;
108  // if(!fEMCImpReader->getTowerADCR(AdcList))return 0;
109  return 1; //1 is good
110  }
111 */
112 
113 
114 int StEMCReader::NTowerHits()
115  {
116  return fEMCImpReader->NTowerHits();
117  }
118 int StEMCReader::NSmdHits()
119  {
120  return fEMCImpReader->NSmdHits();
121  }
122 
123 EMC_Reader* StEMCReader::getBemcReader()
124 {
125  return fEMCImpReader;
126 }
127 
int getSMD_TIMEBIN(int, unsigned int &)
Get SMD time bin (capacitor number) for a given fiber (RDO)
Definition: EMC_Reader.cxx:219
int NTowerHits()
Return number of valid hits on towers.
Definition: EMC_Reader.cxx:80
int NSmdHits()
Return number of valid hits on SMD.
Definition: EMC_Reader.cxx:95
int getSMD_ADC(int, int, unsigned short &)
Get SMD ADC for a given index and fiber (RDO) number.
Definition: EMC_Reader.cxx:199
int getSMDP_ADC(int, int, int, unsigned short &)
Get ADC for SMDP with given module, eta and sub.
Definition: EMC_Reader.cxx:176
int getTowerADC(int, int, int, unsigned short &)
Get ADC value for one tower with given module, eta and sub.
Definition: EMC_Reader.cxx:111
int getSMDE_ADC(int, int, unsigned short &)
Get ADC for SMDE with given module and stip number.
Definition: EMC_Reader.cxx:153