StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSSDReader.cxx
1 /***************************************************************************
2  *
3  *
4  *
5  * Author: Herbert Ward
6  ***************************************************************************
7  *
8  * Description: Offline Wrapper for DAQ SSD 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 #include "StDAQReader.h"
20 #include "StSSDReader.h"
21 #include "StDaqLib/SSD/SSD_Reader.hh"
22 
23 
24 int StSSDReader::getSsdData(int ladder,char eastWest,int channel,int& data,int& pedestal,int& noise) {
25  int rv;
26  if(!fSSDImpReader) return -1;
27  if(ladder<1||ladder>20) return -2;
28  if(eastWest!='E'&&eastWest!='W') return -3;
29  rv = fSSDImpReader->ssdData(ladder,eastWest,channel,data,pedestal,noise);
30  return rv;
31 }
32 StSSDReader::StSSDReader(StDAQReader *daqr) {
33  fSSDImpReader=0;
34  fDAQReader = daqr;
35  delete fSSDImpReader;
36  fSSDImpReader = ::getSSDReader(daqr->getEventReader());
37 }
38 StSSDReader::~StSSDReader() {
39 }
40 int StSSDReader::close() {
41  // delete fSSDImpReader; fSSDImpReader=0;
42  return 1;
43 }
44 int StSSDReader::Update() {
45  delete fSSDImpReader;
46  fSSDImpReader = ::getSSDReader(fDAQReader->getEventReader());
47  // close();
48  cout<<" SSD Updated**"<<endl;
49  return 1;
50 }
51