9 #include "EEdsm1Tree.h"
15 EEdsm1Tree::EEdsm1Tree(
const char *nameX) {
17 int thr[3]={1000, 2000, 3000};
18 int TPthr=100, HTTPthr=100;
21 for(i=0; i<Nee1; i++) ee1[i].setYear(-999, thr, TPthr, HTTPthr);
35 strncpy(name,nameX,mxTxt);
40 EEdsm1Tree::~EEdsm1Tree() {
47 EEdsm1Tree::setYear(
int x,
int *JPth,
int TPthrSelc,
int HTTPthrSelc) {
50 for (i=0;i<Nee1;i++) ee1[i].setYear(mYear, JPth, TPthrSelc, HTTPthrSelc);
55 void EEdsm1Tree :: clear() {
58 for (i=0;i<Nee1;i++) ee1[i].clear();
60 memset(ee1out3JPadc,0,
sizeof(ee1out3JPadc));
61 memset(ee1outJPadc,0,
sizeof(ee1outJPadc));
62 memset(ee1outHT,0,
sizeof(ee1outHT));
63 memset(ee1outTPthrMax, 0,
sizeof(ee1outTPthrMax));
64 memset(ee1outHTTPthrMax, 0,
sizeof(ee1outHTTPthrMax));
73 EEdsm1Tree::setInp16bit(
int brd,
int ch,
unsigned short val){
74 assert(brd>0 && brd<=Nee1);
75 ee1[brd-1].setWord(ch,val);
82 EEdsm1Tree::compute() {
84 for (i=0;i<Nee1;i++) {
95 for (i=0;i<EEnJetPatch;i++) {
96 AdjJPsum[i]=ee1outJPadc[i]+ee1outJPadc[(i+1)%EEnJetPatch];
105 EEdsm1Tree:: getInpTPsum(
int ch)
const {
107 return ee1[ch/6].getInpTPsum(ch%6);
114 EEdsm1Tree::getInpHT2bit(
int ch)
const {
116 return ee1[ch/6].getInpHT2bit(ch%6);
123 EEdsm1Tree::getInpTP2bit(
int ch)
const {
125 return ee1[ch/6].getInpTP2bit(ch%6);
132 EEdsm1Tree::getInpHTTP2bit(
int ch)
const {
134 return ee1[ch/6].getInpHTTP2bit(ch%6);
140 EEdsm1Tree::getInp16bit(
int ch)
const {
142 return ee1[ch/6].getInp16bit(ch%6);
148 EEdsm1Tree::getOutHT2bit(
int ibr)
const {
149 return ee1[ibr].getOutHT2bit();
156 EEdsm1Tree::getOutJP2bit(
int ibr)
const {
157 return ee1[ibr].getOutJP2bit();
164 EEdsm1Tree::getOutTP1bit(
int ibr)
const {
165 return ee1[ibr].getOutTP1bit();
172 EEdsm1Tree::getOutHTTP1bit(
int ibr)
const {
173 return ee1[ibr].getOutHTTP1bit();
179 EEdsm1Tree::getOutEsum5bit(
int ibr)
const {
180 return ee1[ibr].getOutEsum5bit();
186 EEdsm1Tree::getOut16bit(
int ibr)
const {
187 return ee1[ibr].getOut16bit();
194 EEdsm1Tree::print(
int k)
const {
195 printf(
"EEdsm1Tree(%s) , year=%d \n",name,mYear);
197 printf(
"\n\n----------- level-1 -----------------\n ");
199 for(i=0;i<Nee1;i++) {
200 printf(
"\n----------- level-1 Board %2d , ",i+1);
205 printf(
"\n----------- level-1 emulated output \n JP_Falk =");
207 for(i=Njp-1;i>=0; i--) printf(
" %4d ",i);
208 printf(
"\n JP_Steve=");
209 for(i=Njp-1;i>=0; i--) printf(
" %4d ",(i+2)%6+1);
210 printf(
"\n JPsum =");
211 for(i=Njp-1;i>=0; i--) printf(
" %4d ",ee1outJPadc[i]);
212 printf(
"\n HTthr =");
213 for(i=Njp-1;i>=0; i--) printf(
" %4d ",ee1outHT[i]);
215 printf(
"\n AdjJPsum=");
216 for(i=Njp-1;i>=0; i--) printf(
" %4d ",AdjJPsum[i]);
219 printf(
"emul: orTPbit=%d orHTTPbit=%d \n",ee1outTPthrMax[0]||ee1outTPthrMax[1], ee1outHTTPthrMax[0] ||ee1outHTTPthrMax[1]);