StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Altro.h
Go to the documentation of this file.
1 
10 #include <iostream>
11 #include <stdlib.h>
12 #include <stdio.h>
13 #include <string.h>
14 #include "TObject.h"
15 /*
16 g++ -c -o Altro.o Altro.C
17 g++ Altro.o -o Altromain.app Altromain.C
18 g++ -o Altromain.app Altro.C Altromain.C
19 */
20 using namespace std;
21 
22 class Altro : public TObject {
23  public:
24  Altro(int timebins, short* Channel);
25  ~Altro();
26 
27  void ConfigAltro(int ONBaselineCorrection1, int ONTailcancellation, int ONBaselineCorrection2, int ONClipping, int ONZerosuppression);
28  void ConfigBaselineCorrection_1(int mode, int ValuePeDestal, int *PedestalMem, int polarity);
29  void ConfigTailCancellationFilter(int K1, int K2, int K3, int L1, int L2, int L3);
30  void ConfigBaselineCorrection_2(int HighThreshold, int LowThreshold, int Offset, int Presamples, int Postsamples);
31  void ConfigZerosuppression(int Threshold, int MinSamplesaboveThreshold, int Presamples, int Postsamples);
32  void PrintParameters();
33  void RunEmulation();
34  float calculatecompression();
35 
36  enum { DIN_FPD, DIN_FT, DIN_FDIN, DIN_FDIN_VPD, DIN_VPD_FPD, DIN_VPD_FT, DIN_VPD_FDIN, DIN_VPD_FDIN_VPD, FDIN_FPD, FDIN_VPD_FPD, FT_FPD, FT_FT, FDIN_FDIN,FDIN_VPD_FDIN_VPD, DIN_FPD1, DIN_FPD2
53  };
54  private:
55  int ftimebins;
56 
57  short *channelIn;
58  short *channelShort;
59  public:
60  short *ADCkeep;
61  private:
62  int fOnBSL1;
63  int fOnTCF;
64  int fOnBSL2;
65  int fOnClip;
66  int fOnZSU;
67 
68  int fConfiguredAltro;
69  int fConfiguredBSL1;
70  int fConfiguredTCF;
71  int fConfiguredBSL2;
72  int fConfiguredZSU;
73 
74  int fBSL1mode;
75  int fBSL1ValuePeDestal;
76  int* fBSL1PedestalMem;
77  int fBSL1polarity;
78 
79  float fTCFK1;
80  float fTCFK2;
81  float fTCFK3;
82  float fTCFL1;
83  float fTCFL2;
84  float fTCFL3;
85 
86  int fTCFK1Int;
87  int fTCFK2Int;
88  int fTCFK3Int;
89  int fTCFL1Int;
90  int fTCFL2Int;
91  int fTCFL3Int;
92 
93  int fBSL2HighThreshold;
94  int fBSL2LowThreshold;
95  int fBSL2Offset;
96  int fBSL2Presamples;
97  int fBSL2Postsamples;
98 
99  int fZSUThreshold;
100  int fZSUMinSamplesaboveThreshold;
101  int fZSUPresamples;
102  int fZSUPostsamples;
103 
104  void BaselineCorrection_1(int mode, int FixedPeDestal, int *PedestalMem, int polarity);
105  void TailCancellationFilter_FixedPoint(int K1, int K2, int K3, int L1, int L2, int L3);
106  void BaselineCorrection_2_RTL(int HighThreshold, int LowThreshold, int Offset, int Presamples, int Postsamples);
107  void Clipping();
108  void Zerosuppression(int Threshold, int MinSamplesaboveThreshold, int Presamples, int Postsamples);
109 
110  short getElement(short* Array,int index);
111  void setElement(short* Array,int index,short value);
112 
113  int inBand(int ADC,int bsl, int LowThreshold, int HighThreshold);
114  int inRange(int parameter,int Low,int High,const char *Module,const char *ParameterName);
115  short GetShortChannel(int i);
116  short GetKeepChannel(int i);
117  int multiply36(int P, int N);
118  long long mask(long long in, int left, int right);
119  long long maskandshift(long long in, int left, int right);
120 };
Definition: Altro.h:22