HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HarpoDccDecode.cxx
Go to the documentation of this file.
1 //
2 // File HarpoDccDecode.cxx
3 //
8 #include "HarpoDccDecode.h"
9 #include "HarpoDebug.h"
10 #include <cstdlib>
11 #include <cstring>
12 #include <iostream>
13 using namespace std;
14 
15 ClassImp(HarpoDccDecode)
17 // code from subroutine decodag
19 {
20  Int_t raw, plane,iafter, strip, io, iv;
21  Int_t isignal = 0;
22  Int_t ibruit = 0;
23  for (Int_t i=0; i<NSTRIPS; i++)
24  {
25  iafter = i/76+1;
26  strip = i + 1 - (iafter-1)*76 ;
27  iafter = 5 - iafter;
28 
29  if(strip == 1)
30  {
31  ibruit = 0;
32  isignal = 0;
33  }
34 
35  if(strip==13||strip==26||strip==51||strip==64)
36  {
37  ibruit = ibruit +1;
38  raw = ibruit + 288 + (iafter-1)*4;
39  }
40  else
41  {
42  isignal = isignal + 1;
43  raw = isignal + (iafter-1)*72;
44  }
45 
46  for (plane= 0; plane < 2; plane ++)
47  {
48  if (plane == 0)
49  {
50  io = raw%2;
51  iv = -1 + 2*io;
52  this->Row2Strip[plane][i] = raw + iv;
53  }
54  else
55  {
56  this->Row2Strip[plane][i] = raw;
57  }
58  }
59  // this->Strip2Raw[plane-1, raw] = i;
60  }
61 }
62 
64 // May be made inline
65 Int_t HarpoDccDecode::decode(Int_t raw, Int_t plane)
66 {
67  if(gHarpoDebug>2)
68  Info("decode","row = %d, plane = %d",raw,plane);
69  Int_t tmp = Row2Strip[plane][raw]-1;
70  return tmp;
71 }
72 
74 // May be made inline
75 Int_t HarpoDccDecode::invdecode(Int_t strip, Int_t /* plane */ )
76 {
77  return strip;
78 }
79 
80 
81 
83 
86 {
87  for(Int_t i=0; i<NSTRIPS; i++) {
88  for(Int_t j=0; j<NPLANES; j++) {
89  cout << this->Row2Strip[j][i] << endl;
90  }
91  }
92 }
virtual void print()
Print decode matrices.
Int_t invdecode(Int_t strip, Int_t plane)
Strip Number to Raw address decoding routine.
A class which define DCC channel mapping.
Long64_t gHarpoDebug
Definition: HarpoDebug.cxx:9
Int_t decode(Int_t raw, Int_t plane)
Raw address to Strip Number decoding routine.
#define NSTRIPS
#define NPLANES