StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FTPV1P0_CPP_SR.cxx
1 /***************************************************************************
2  * $Id: FTPV1P0_CPP_SR.cxx,v 1.5 2007/12/24 06:04:13 fine Exp $
3  * Author: Jeff Landgraf, M.J. LeVine, J.Klay, H.Huemmler
4  ***************************************************************************
5  * Description:
6  *
7  *
8  * change log
9  *
10  ***************************************************************************
11  * $Log: FTPV1P0_CPP_SR.cxx,v $
12  * Revision 1.5 2007/12/24 06:04:13 fine
13  * introduce OLDEVP namespace to allow ole and new EVP library concurrently
14  *
15  * Revision 1.4 2003/09/02 17:55:31 perev
16  * gcc 3.2 updates + WarnOff
17  *
18  * Revision 1.3 2001/06/27 22:06:54 jcs
19  * Remove unused variables mz, rb
20  *
21  * Revision 1.2 2001/06/25 22:58:54 jcs
22  * cleanup code
23  *
24  * Revision 1.1 2000/01/18 18:01:19 levine
25  * Hummler's implementaiton of FTPC reader. Note that method
26  *
27  * FTPV1P0_ZS_SR::getFeeSequences(int Fee, int Pin, int *nSeq,
28  * Sequence **SeqData)
29  *
30  * causes exit() since the required #include file has not yet been
31  * (correctly) implemented.
32  *
33  *
34  **************************************************************************/
35 
36 #include <Stiostream.h>
37 
38 #include "StDaqLib/GENERIC/EventReader.hh"
39 #include "FTPV1P0.hh"
40 // FTP V1.0 Raw Reader
41 using namespace OLDEVP;
42 
43 FTPV1P0_CPP_SR::FTPV1P0_CPP_SR(int s, FTPV1P0_Reader *det)
44 {
45  // cout << "Constructing FTPV1P0_CPP_SR" << endl;
46  sector = s;
47  detector = det;
48 
49  // NULLS in banks array
50  bank = 0;
51 // memset((char *)bank, 0, sizeof(bank));
52 }
53 
54 int FTPV1P0_CPP_SR::initialize()
55 {
56  // get a sector reader for PADK
57  // printf("FTPV1P0_CPP_SR::initialize() sector %d\n",sector);
58  padkr = detector->getPADKReader(sector);
59  if (!padkr) return FALSE;
60  // printf("FTPV1P0_CPP_SR::initialize() SUCCESS sector %d\n",sector);
61 
62  // store pointers to the CPP banks
63  bank = detector->getBankFTPCPPR(sector);
64  classname(Bank_FTPCPPR) *cpp = bank;
65  if (cpp && detector->ercpy->verbose)
66  { printf("ASIC params sec %d: TH_LO %d, TH_HI %d, NSEQ_LO %d, NSEQ_HI %d\n",sector,
67  cpp->asic_params.thresh_lo,
68  cpp->asic_params.thresh_hi,
69  cpp->asic_params.n_seq_lo,
70  cpp->asic_params.n_seq_hi);
71  }
72  return TRUE;
73 }
74 
75 FTPV1P0_CPP_SR::~FTPV1P0_CPP_SR()
76 {
77  // cout << "Deleting FTPV1P0_CPP_SR" << endl;
78 }
79 
80 int FTPV1P0_CPP_SR::getClusters(int PadRow, int Pad,
81  int *nClusters, struct ASIC_Cluster **clusters)
82 {
83  // Return a pointer to the cluster array for this (padrow,pad)
84  int i;
85  FTPPADK_entry ent;
86 
87  // check pad, padrow for validity
88  if (PadRow==0 || PadRow>FTP_PADROWS) {
89  printf(" %s %d padrow not a legal value: %d\n", __FILE__,__LINE__,PadRow);
90  return -1;
91  }
92  padkr->get(PadRow, Pad, &ent);
93  if (!(void *)bank) {
94  printf(" %s %d no CPP bank for sector %d\n",__FILE__,__LINE__,sector);
95  printf(" PadRow %d, Pad %d\n", PadRow, Pad);
96  return -1;
97  //test for CPPR bank for this sector
98  }
99 
100  clusters[Pad-1] = (ASIC_Cluster *)(bank->entry + 32*ent.offset);
101  for (i=0; i<31; i++) { //loop over ASIC sequences
102  if (clusters[Pad-1][i].start_time_bin < 0) break;
103  }
104 
105  *nClusters = i; //set number of valid clusters in array
106  return 0;
107 }
108 
109 
110 int FTPV1P0_CPP_SR::MemUsed()
111 {
112  return 0;
113 }
114 
115 
116 
Definition: FTPV1P0.hh:198