StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGenericL2Emulator2009.cxx
1 // Pibero Djawotho <pibero@tamu.edu>
2 // Texas A&M University
3 // 16 April 2010
4 // Original StGenericL2Emulator by Jan Balewski <balewski@mit.edu> and Renee Fatemi <rfatemi@pa.uky.edu>
5 // Interfaces L2 algos to the STAR ofl software
6 
7 #include "StChain.h"
8 #include "St_DataSetIter.h"
9 
10 #include <Stiostream.h>
11 #include <math.h>
12 
13 #include "TFile.h"
14 #include "TArrayF.h"
15 
16 #include <StMessMgr.h>
17 
18 
19 // ETOW stuff
20 #include <StEEmcUtil/database/StEEmcDb.h>
21 #include <StEEmcUtil/database/EEmcDbItem.h>
22 #include <StEEmcUtil/database/EEmcDbCrate.h>
23 
24 
25 // BTOW stuff
26 #include "StEmcUtil/geometry/StEmcGeom.h"
27 #include "StEmcUtil/database/StBemcTables.h"
28 #include "StEmcUtil/database/StEmcDecoder.h"
29 
30 // StEvent
31 #include "StEventTypes.h"
32 #include "StEvent/StEvent.h"
33 #include "StEvent/StEmcCollection.h"
34 #include "StEvent/StEmcDetector.h"
35 #include "StEvent/StTriggerId.h"
36 #include "StEvent/StTriggerIdCollection.h"
37 
38 //MuDst
39 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
40 #include "StMuDSTMaker/COMMON/StMuDst.h"
41 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
42 #include "StMuDSTMaker/COMMON/StMuEvent.h"
43 
44 //L2 stuff
45 #include "L2algoUtil/L2EmcDb.h"
46 #include "L2algoUtil/L2EmcGeom.h"
47 #include "L2algoUtil/L2DbConfig.h" // time-dep config
48 #include "L2algoUtil/L2DbTime.h" // time-dep config
49 #include "L2algoUtil/L2btowCalAlgo09.h"
50 #include "L2algoUtil/L2etowCalAlgo09.h"
51 #include "L2pedAlgo/L2pedAlgo09.h"
52 
53 //trg-data from ezTree, to read on-line decision, tmp
54 #include "StMuDSTMaker/EZTREE/EztTrigBlob.h" // to access DB time stamp
55 #include "St_db_Maker/St_db_Maker.h"
56 
57 // L0-trigSimu
58 #include "StTriggerSimuMaker.h"
59 #include "StTriggerUtilities/Eemc/StEemcTriggerSimu.h"
60 #include "StTriggerUtilities/Eemc/EMCdsm2Tree.h"
61 
62 #include "StGenericL2Emulator2009.h"
63 
64  /* usefull dimensions */
65 #define MaxBtowRdo (L2EmcDb::BTOW_MAXFEE*L2EmcDb::BTOW_DATSIZE)
66 #define MaxEtowRdo (L2EmcDb::ETOW_MAXFEE*L2EmcDb::ETOW_DATSIZE)
67 
69 
71  mBTOW_BANK =new unsigned short [MaxBtowRdo];
72  mETOW_BANK =new unsigned short [MaxEtowRdo];
73  mUseMuDst=true;
74  setMC(false);
75 
76  mSetupPath="wrong2";
77  mOutPath="wrong3";
78  mYear=-1;
79  mYearMonthDay=-2;
80  mHourMinSec=-3;
81 }
82 
83 //________________________________________________________
84 //________________________________________________________
85 
86 StGenericL2Emulator2009::~StGenericL2Emulator2009(){
87  delete [] mBTOW_BANK;
88  delete [] mETOW_BANK;
89 
90 }
91 
92 
93 
94 
95 //________________________________________________________
96 //________________________________________________________
97 
98 void StGenericL2Emulator2009::init(){
99  mTotInpEve=0;
100  //................EEMC stuff ..............
101  mDbE = (StEEmcDb*)StMaker::GetChain()->GetDataSet("StEEmcDb");
102  assert(mDbE);
103  mGeomB = StEmcGeom::instance("bemc");
104  //....
105  mL2EmcDb=0; // will be instantiated in InitRun
106  mL2EmcGeom=0;
107 
108  LOG_INFO << Form("generic:init() , use: MuDst=1 (StEvent=0)=%d isMC=%d",mUseMuDst,mMCflag) <<endm;
109 }
110 
111 //____________________________________________________________
112 //____________________________________________________________
113 //____________________________________________________________
114 void
115 StGenericL2Emulator2009::make(){
116 #if 0 // filter some events base on L0-trigger decision, if you want
117  int L0trgSwitch=1; // flag passed to L2-algos, derived from L0 decision
118  StTriggerSimuMaker *L0trgSim=(StTriggerSimuMaker *)StMaker::GetChain()->GetMaker("StarTrigSimu");
119  assert(L0trgSim);
120  // L0trgSim->eemc->dsm3TRG->print();
121  EMCdsm2Tree *dsm2tree=L0trgSim->eemc->dsm2TreeADC; // use response based on ADC
122  LOG_INFO<<Form("sim L0,dsm2,EEMC: EJP2bit=%d; EEtot1bit=%d , val=%d",
123  dsm2tree->getOutEndcapJP2bit(), dsm2tree->getOutEndcapSum1bit(),dsm2tree->getIntEndcapSum())<<endm;
124 
125  if(dsm2tree->getOutEndcapJP2bit()==0) return;
126 
127  //....... processing only events w/ EJP0 ....., just an example
128  L0trgSwitch=1; // can assigne here a different value depending on L0 sim
129 #endif
130 
131 
132  mTotInpEve++;
133 
134 
135  if(mUseMuDst) {// pick one source of ADCs
136  doBanksFromMuDst();
137  } else {
138  doBanksFromStRawData();
139  }
140 
141  const int fakeToken1 = 1;
142  const int fakeToken2 = 2;
143  L2btowCalAlgo09* l2btowCal09 = dynamic_cast<L2btowCalAlgo09*>(mL2algo[0]);
144  L2etowCalAlgo09* l2etowCal09 = dynamic_cast<L2etowCalAlgo09*>(mL2algo[1]);
145  L2pedAlgo09* l2ped = dynamic_cast<L2pedAlgo09*>(mL2algo[2]);
146  l2btowCal09->calibrateBtow(fakeToken2,mBTOW_in,mBTOW_BANK);
147  l2etowCal09->calibrateEtow(fakeToken2,mETOW_in,mETOW_BANK);
148  int nInpTrg = StMaker::GetChain()->GetIventNumber();
149  l2ped->doPedestals(nInpTrg,(int*)mL2Result,mBTOW_in,mBTOW_BANK,mETOW_in,mETOW_BANK);
150  for(size_t ia=3;ia<mL2algo.size();ia++) {//execute all instantiated L2algos
151  if(mL2algo[ia]==0) continue;
152  mL2algo[ia]->compute(fakeToken2);
153  mL2algo[ia]->decision(fakeToken2,mBTOW_in,mETOW_in,(int*)mL2Result);
154  } // tmp, accept should be filled in internaly, in next iteration, Jan
155  l2btowCal09->clear(fakeToken1);
156  l2etowCal09->clear(fakeToken1);
157  // printf("L2Generic::make BB=%d EE=%d \n",mBTOW_in,mETOW_in);
158 
159  addTriggerList();
160 }
161 
162 
163 //========================================
164 //========================================
165 void
166 StGenericL2Emulator2009::initRun1(){
167  //WARN: do NOT use runNo for any setup - it would berak for M-C
168 
169  St_db_Maker* mydb = (St_db_Maker*) StMaker::GetChain()->GetMaker("StarDb");
170  assert(mydb);
171  mYear=mydb->GetDateTime().GetYear();
172  mYearMonthDay=mydb->GetDateTime().GetDate();
173  mHourMinSec=mydb->GetDateTime().GetTime();
174 
175 
176  //define path for L2 setup files & output
177  mSetPath=Form("%sL2/%d/db/",mSetupPath.Data(),mYear);
178  LOG_INFO <<"initRun1() "<<"DB setPath="<<mSetPath.Data()<<" outPath="<<mOutPath.Data()<<endm;
179 
180  // read in time-dependent L2 configuration
181  L2DbConfig confDB1(mSetPath+"/L2DbTime.dat");
182  L2DbTime * confL2 = confDB1.getConfiguration( mYearMonthDay, mHourMinSec );
183  assert( confL2 ); // trigger code has not been setup properly
184 
185 
186  // create new L2Db instance , new per run
187  if(mL2EmcDb) delete mL2EmcDb;
188  mL2EmcDb=new L2EmcDb((char*)mSetPath.Data(),(char*)mOutPath.Data());
189  // override default ped and mask files
190  mL2EmcDb->setPedFile ( confL2->getPedFile() );
191  mL2EmcDb->setMaskFile( confL2->getMaskFile() );
192 
193  // Create L2 geometry interface
194  mL2EmcGeom = new L2EmcGeom;
195 
196  // access BTOW DB only re-map ADC back to rdo indexing
197  StBemcTables *myTable=new StBemcTables;
198  StMaker* maker= StMaker::GetChain()->GetMaker("StarDb");
199  myTable->loadTables(maker );
200  // this is how BTOW mapping is accesible
201  mMappB = new StEmcDecoder(mydb->GetDateTime().GetDate(),mydb->GetDateTime().GetTime());
202  LOG_INFO << "initRun1() done"<<endm;
203 
204 
205 }
206 
207 //========================================
208 //========================================
209 void
210 StGenericL2Emulator2009::initRun2(int runNo){
211  assert(mL2EmcDb->initRun(runNo) == 0);
212  //WARN: do NOT use runNo for any setup - it would berak for M-C
213  // read in time-dependent L2 offline trigger ID's
214  enum {mxPar=10}; // maximuma for any algo, separate ints & floats
215  int intsPar[mxPar]; // params passed from run control gui
216  float floatsPar[mxPar];
217 
218  LOG_INFO << Form("initRun2() run#=%d begin",runNo)<<endm;
219  L2DbConfig confDB2(mSetPath+"/L2TriggerIds.dat");
220 
221  for(size_t ia=0;ia<mL2algo.size();ia++) { //initialize trigger ID for given L2-algo
222  // printf("uu i=%d, =%s=\n",ia,mL2algo[ia]->getName());
223  if (mL2algo[ia]==0) continue;
224  TString algoName=mL2algo[ia]->getName();
225  L2DbTime *config = confDB2.getConfiguration(mYearMonthDay,mHourMinSec,algoName);
226  if(config==0) {
227  LOG_ERROR << Form("\n************\ninitRun2() failed L2-%s configuration for yyyy=%d hhmmss=%d,\n On explicit request from Renee, the L2 emulator will continue with disabled this particulra L2-algo.\nThis will result with false positives - ignore emulated trigger results for this algo,\nIt would be much better to fix the setup and provide missing record.\nYou have been warned, Jan B.\n***********\n",algoName.Data(),mYearMonthDay,mHourMinSec)<<endm;
228  mL2algo[ia]=0; continue;
229  // assert(config); disabed to let the code go dispite missing setup, Jan
230  }
231  TString aa1 = config->getBuf1(); // setup name
232  TString aa2 = config->getBuf2();
233  Int_t trgId = atoi(aa2.Data());
234  LOG_INFO<<Form("L2algo=%s=initRun2(), trigID=%d setup=%s= ",algoName.Data(),trgId,aa1.Data())<<endm;
235 
236  TString fullPath=Form("%sL2/%d/algos/%s", mSetupPath.Data(), mYear,aa1.Data());
237  L2VirtualAlgo2009::readParams(fullPath, mxPar, intsPar, floatsPar);// tmp, no check of # of params
238  mL2algo[ia]->initRun(runNo,intsPar,floatsPar);
239  mL2algo[ia]->setOflTrigID(trgId);
240  }
241  LOG_INFO << "initRun2() done"<<endm;
242 }
243 
244 //========================================
245 
246 StTriggerSimuDecision
247 StGenericL2Emulator2009::isTrigger(int trigId) {
248  if (mAcceptTriggerList.find(trigId) != mAcceptTriggerList.end()) return kYes;
249  if (mVetoTriggerList.find(trigId) != mVetoTriggerList.end()) return kNo;
250  return kDoNotCare;
251 }
252 
253 //========================================
254 //========================================
255 void
256 StGenericL2Emulator2009::finish() {
257 
258  LOG_INFO <<"Finish()=======\n totEveSeen="<< mTotInpEve<<endm;
259 
260  for(size_t ia=0;ia<mL2algo.size();ia++) //execute all instantiated L2algos
261  if(mL2algo[ia]) mL2algo[ia]->finishRun();
262  LOG_INFO <<"Finish()======= end"<<endm;
263 
264 }
265 //========================================
266 //========================================
267 void
268 StGenericL2Emulator2009::clear( ){
269  mBTOW_in=mETOW_in=0;
270  memset(mBTOW_BANK,0,MaxBtowRdo*sizeof(unsigned short));
271  memset(mETOW_BANK,0,MaxEtowRdo*sizeof(unsigned short));
272  memset(mL2Result,0,sizeof(mL2Result));
273  mAcceptTriggerList.clear();
274  mVetoTriggerList.clear();
275 }
276 
277 
278 //____________________________________________________________
279 //____________________________________________________________
280 //____________________________________________________________
282  StEvent* mEvent = (StEvent*)StMaker::GetChain()-> GetInputDS("StEvent");
283  assert(mEvent); // fix your chain
284  StEmcCollection* emcCollection = mEvent->emcCollection();
285 
286  StEmcDetector* twB = emcCollection->detector(kBarrelEmcTowerId);
287  StEmcDetector* twE = emcCollection->detector(kEndcapEmcTowerId);
288  if(twE==0) {
289  printf(" StGenericL2Emulator2009 found no E-EMC tower data in StEvent, skip event\n");
290  return ;
291  }
292 
293  int i;
294 
295  if(twB) {
296  printf(" StGenericL2Emulator2009:: B_EMC Tower HITS ...\n");
297  for ( i = 1; i <= (int)twB->numberOfModules(); i++) { // The B-EMC modules
298  StSPtrVecEmcRawHit& emcTowerHits = twB->module(i)->hits();
299  unsigned int j;
300  for ( j = 0; j < emcTowerHits.size(); j++) {
301  int adc= emcTowerHits[j]->adc();
302  int mod= emcTowerHits[j]->module();
303  int sub= emcTowerHits[j]->sub();
304  int eta= emcTowerHits[j]->eta();
305  float energy= emcTowerHits[j]->energy();
306  printf("j=%d, mod=%d, sub=%d, eta=%d adc=%d ener=%f\n",j,mod,sub,eta,adc,energy);
307  }
308  }
309  } else {
310  printf("StGenericL2Emulator2009 found no B-EMC tower data in StEvent, skip event\n");
311  }
312 
313  if(twE) {
314  printf("StGenericL2Emulator2009:: E_EMC Tower HITS ... %d\n",twE->numberOfModules());
315  for ( i = 0; i < (int)twE->numberOfModules(); i++) { // The E-EMC modules
316  // printf("AAA %d\n",i);
317  StEmcModule* stmod = twE->module(i);
318  if(stmod==0) continue;
319  StSPtrVecEmcRawHit& emcTowerHits = stmod->hits();
320  unsigned int j;
321  for ( j = 0; j < emcTowerHits.size(); j++) {
322  int adc= emcTowerHits[j]->adc();
323  int sec= emcTowerHits[j]->module()+1;
324  int sub= emcTowerHits[j]->sub()+'A';
325  int eta= emcTowerHits[j]->eta()+1;
326  float energy= emcTowerHits[j]->energy();
327  printf("j=%d, sec=%d, sub=%c, eta=%d adc=%d ener=%f\n",j,sec,sub,eta,adc,energy);
328  }
329  }
330  } else {
331  printf("StGenericL2Emulator2009 found no E-EMC tower data in StEvent, skip event\n");
332  }
333 
334 }
335 
336 
337 //========================================
338 //========================================
339 void
340 StGenericL2Emulator2009::doBanksFromStRawData(){
341  assert(mUseMuDst==false);
342  return; // tmp disabled, see below
343  assert(1==2); // define E/BTOW_in=1 somehow before use, JB
344 
345  StEvent *mEvent = (StEvent *)StMaker::GetChain()-> GetInputDS("StEvent");
346  if (!mEvent) {
347  LOG_ERROR<< "StGenericL2Emulator2009::getStEmcDetector() -- no StEvent found" << endm; return ;
348  }
349  StEmcCollection *emcColl = mEvent->emcCollection();
350  if (!emcColl) {
351  return ;
352  }
353 
354  int icr;
355 
356  //.................BTOW is simple ........
357  StEmcRawData *rawB = mEvent->emcCollection()->bemcRawData();
358  assert(rawB);
359  icr=0;
360  printf(" BTOW size=%d\n",rawB->sizeData(icr));
361  assert(rawB->sizeData(icr) <=MaxBtowRdo);
362  unsigned short* adc=rawB->data(icr);
363  int i;
364  // copy BTOW ADCs 1:1
365  for(i=0;i<rawB->sizeData(icr);i++) mBTOW_BANK[i]=adc[i];
366 
367  //...........ETOW : transpose crates & channals back to oryginal daq format
368  StEmcRawData *rawE = mEvent->emcCollection()->eemcRawData();
369  assert(rawE);
370  assert(rawE->sizeData(icr) <=MaxEtowRdo);
371 
372  for(icr=0;icr<mDbE->getNFiber();icr++) {
373  const EEmcDbCrate *fiber=mDbE->getFiber(icr);
374  if(fiber->crID>6) continue; // drop non-tower crates
375  if(rawE->sizeHeader(icr)<=0) continue; // unused fibers
376  assert(fiber->useIt); // code not ready to handle masked crates
377  printf(" ETOW crID=%d type=%c size=%d\n",fiber->crID,fiber->type,rawE->sizeData(icr));
378  assert(fiber->crID==icr+1);
379  unsigned short* adc=rawE->data(icr);
380  int i;
381  for(i=0;i<rawE->sizeData(icr);i++) {
382  int rdo=icr + i*L2EmcDb::ETOW_MAXFEE;
383  assert(rdo>=0 && rdo<MaxEtowRdo); // siher ist siher
384  mETOW_BANK[rdo]=adc[i];
385  }
386  // for(i=0;i<30;i++) printf("ch=%d adc=%d\n",i,adc[i]);//test
387  }
388 
389 }
390 
391 
392 
393 
394 
395 
396 //========================================
397 //========================================
398 void
399 StGenericL2Emulator2009::doBanksFromMuDst(){
400 
401  assert(mUseMuDst==true);
402 
403  StEvent *mEvent = (StEvent*)StMaker::GetChain()-> GetInputDS("StEvent");
404  assert(mEvent);
405 
406  StMuDstMaker *muMk = (StMuDstMaker*)StMaker::GetChain()->GetMaker("MuDst");
407  assert(muMk);
408 
409  StMuEmcCollection* muEmc = muMk->muDst()->muEmcCollection();
410 
411  //......................... E T O W ....................
412  int nE=0;
413  int i;
414  for (i=0; i < muEmc->getNEndcapTowerADC(); i++) {
415  int sec,eta,sub,rawAdc; //muDst ranges:sec:1-12, sub:1-5, eta:1-12
416  muEmc->getEndcapTowerADC(i,rawAdc,sec,sub,eta);
417  assert(sec>0 && sec<=MaxSectors);// total corruption of muDst
418  //Db ranges: sec=1-12,sub=A-E,eta=1-12,type=T,P-R ; slow method
419  const EEmcDbItem *x=mDbE->getTile(sec,'A'+sub-1,eta,'T');
420  assert(x); // DB mapping must be provided for all channels
421  assert(x->crate>0);
422  assert(x->crate<=6);
423  int rdo=x->crate-1 + x->chan*L2EmcDb::ETOW_MAXFEE;
424  mETOW_BANK[rdo]=rawAdc;
425  nE++;
426  }
427  mETOW_in=1;
428  LOG_DEBUG << Form("doBanksFromMuDst() , ETOW nAdc=%d",nE)<<endm; assert(nE==720);
429 
430 
431  //......................... B T O W ....................
432  //use StEvent as default to get simulation right in BEMC
433  if( mEvent)
434  {
435  StEmcCollection *emc = mEvent->emcCollection();
436  if (emc)
437  {
438  StEmcDetector* detector=emc->detector(kBarrelEmcTowerId);
439  if(detector)
440  {
441  for(Int_t m = 1; m <= 120; ++m)
442  {
443  StEmcModule* module = detector->module(m);
444  if(module)
445  {
446  StSPtrVecEmcRawHit& rawHit=module->hits();
447  for(UInt_t k = 0; k < rawHit.size(); ++k)
448  {
449  if(rawHit[k])
450  {
451  int did, RDO;
452 
453  Int_t m=rawHit[k]->module();
454  Int_t e=rawHit[k]->eta();
455  Int_t s=abs(rawHit[k]->sub());
456  Int_t adc=rawHit[k]->adc();
457 
458  //Get software tower id to get DaqID
459  mGeomB->getId(m,e,s,did);
460  mMappB->GetDaqIdFromTowerId(did,RDO);
461  mBTOW_BANK[RDO]=adc;
462  }
463  }
464  }
465  }
466  }
467  }
468  mBTOW_in=1;
469  }
470  else
471  {
472 
473  int nB=0;
474  int id;
475  for (id=1; id <=4800 ; id++)
476  {
477  int rawAdc= muEmc->getTowerADC(id);
478  int RDO;
479  assert(mMappB->GetDaqIdFromTowerId(id,RDO)==1);// is good range
480  mBTOW_BANK[RDO]=rawAdc;
481  nB++;
482  }
483 
484  mBTOW_in=1; // tmp, it should detectd there is no BTOW data
485  /*The easiest way in muEmcCollection is
486  getCrateStatus(int crate, int detector = bemc)
487  This is just a placehold so there is no methods to check stuff.
488  Alex
489  */
490 
491  LOG_INFO << Form("doBanksFromMuDst() , BTOW nAdc=%d",nB)<<endm;
492  assert(nB==4800);
493 
494  }
495 
496 }
497 
498 //========================================
499 //========================================
500 void
502  int i;
503 
504  printf("printBEblocks(), just begin & end of each block, mBTOW_in=%d mETOW_in=%d\n",mBTOW_in,mETOW_in);
505 
506  if(mBTOW_in) {
507  for(i=0;i<10;i++) printf("BTOWi=%d ADC=%d\n",i,mBTOW_BANK[i]);
508  for(i=4790;i<4800;i++) printf("BTOWi=%d ADC=%d\n",i,mBTOW_BANK[i]);
509  }
510 
511  if( mETOW_in){
512  for(i=0;i<10;i++) printf("ETOWi=%d ADC=%d\n",i,mETOW_BANK[i]);
513  for(i=710;i<720;i++) printf("ETOWi=%d ADC=%d\n",i,mETOW_BANK[i]);
514  }
515 }
516 
517 
518 
519 //========================================
520 void
521 StGenericL2Emulator2009::addTriggerList() {
522 
523  for(size_t ia=0;ia<mL2algo.size();ia++) {
524  if (mL2algo[ia]==0) continue;
525  if (mL2algo[ia]->getOflTrigID()==0) continue; // undefined triggerID
526  if (mL2algo[ia]->isAccepted()) {
527  mAcceptTriggerList.insert(mL2algo[ia]->getOflTrigID());
528  }
529  else {
530  mVetoTriggerList.insert(mL2algo[ia]->getOflTrigID());
531  }
532  }
533 
534  LOG_DEBUG << Form("addTriggerList() yesSize=%d vetoSize=%d",mAcceptTriggerList.size(),mVetoTriggerList.size())<<endm;
535 }
StMuDst * muDst()
Definition: StMuDstMaker.h:425
void setPedFile(const char *c)
Definition: L2EmcDb.cxx:30
int useIt
flag to ignore data from misconfig/broken crate/box
Definition: EEmcDbCrate.h:19
void printBEtowers()
hits in StEvent
void setMaskFile(const char *c)
Definition: L2EmcDb.cxx:31
void loadTables(StMaker *anyMaker)
load tables.
void printBEblocks()
regenerated banks
char type
is &#39;T&#39; for towers &amp; &#39;S&#39; for MAPMT
Definition: EEmcDbCrate.h:18
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
Definition: StMuDst.h:389
virtual Int_t GetIventNumber() const
Returns the current event number.
Definition: StMaker.cxx:1033
int crID
logical crate ID
Definition: EEmcDbCrate.h:13
int GetDaqIdFromTowerId(int softId, int &RDO) const
Get Daq Id from Software Id for towers.
int chan
hardware channel
Definition: EEmcDbItem.h:28