StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtHybridDaqPed.cc
1 /***************************************************************************
2  *
3  * $Id: StSvtHybridDaqPed.cc,v 1.1 2001/07/11 23:29:48 munhoz Exp $
4  *
5  * Author: Marcelo Munhoz
6  ***************************************************************************
7  *
8  * Description: SVT Hybrid Data BASE class
9  *
10  ***************************************************************************
11  *
12  * $Log: StSvtHybridDaqPed.cc,v $
13  * Revision 1.1 2001/07/11 23:29:48 munhoz
14  * adding capability for zero suppressed and pedestal reading
15  *
16  *
17  **************************************************************************/
19 // //
20 // This is the class to access the data from each hybrid. //
21 // //
23 
24 #include "StSvtHybridDaqPed.hh"
25 #include "StDAQMaker/StSVTReader.h"
26 
27 ClassImp(StSvtHybridDaqPed)
28 
29 StSvtHybridDaqPed::StSvtHybridDaqPed(int barrel, int ladder, int wafer, int hybrid, StSVTReader* reader) :
30  StSvtHybridPed(barrel, ladder, wafer, hybrid)
31 {
32  if (reader)
33  setHybridPed(reader);
34 }
35 
36 int StSvtHybridDaqPed::setHybridPed(StSVTReader* reader)
37 {
38  int anode, time, nAnodes = 240, n, status=0;
39  float ped;
40  unsigned char* array;
41 
42  for (anode=1;anode<=nAnodes;anode++) {
43 
44  status = reader->getPedestals(mBarrel, mLadder, mWafer, mHybrid, anode, n, array);
45 
46  if (status != 1) return status;
47 
48  for (time=0;time<n;time++) {
49  ped = array[time];
50  //cout << "anode = " << anode << " ,time = " << time << endl;
51  addToPixel(anode, time, ped);
52  }
53  }
54 
55  return status;
56 }
57 
58 int StSvtHybridDaqPed::setHybridRMSPed(StSVTReader* reader)
59 {
60  int anode, time, nAnodes = 240, n, status=0;
61  float ped;
62  unsigned char* array;
63 
64  for (anode=1;anode<=nAnodes;anode++) {
65 
66  status = reader->getRMSPedestals(mBarrel, mLadder, mWafer, mHybrid, anode, n, array);
67 
68  if (status != 1) return status;
69 
70  for (time=0;time<n;time++) {
71  ped = array[time];
72  //cout << "anode = " << anode << " ,time = " << time << endl;
73  addToPixel(anode, time, ped);
74  }
75  }
76 
77  return status;
78 }