StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StOnlineTriggerMonitoring.cxx
1 #include "StOnlineTriggerMonitoring.h"
2 #include <iostream>
3 #include <fstream>
4 #include <cstdlib>
5 #include <stdio.h>
6 using namespace std;
7 
8 #include <TROOT.h>
9 #include <TSystem.h>
10 #include <TFile.h>
11 #include <TString.h>
12 
13 #include "StMessMgr.h"
14 
15 #include "StDbLib/StDbManager.hh"
16 #include "StDbLib/StDbConfigNode.hh"
17 #include "StDbLib/StDbTable.h"
18 #include "StDbLib/StDataBaseI.hh"
19 
20 #include "tables/St_emcTriggerStatus_Table.h"
21 #include "tables/St_emcTriggerPed_Table.h"
22 #include "tables/St_emcTriggerLUT_Table.h"
23 #include "tables/St_bemcTriggerPed4_Table.h"
24 
25 #include "StEmcUtil/database/StEmcDecoder.h"
26 #include "StEmcUtil/database/StBemcTablesWriter.h"
27 
28 char BITMASK[15][130];
29 int PATCH[300], DSM[300], BIT[300], PA[300], HT[300], TOWER[30][160], PED[30][160], PEDRMS[30][160], BITCONV[30][10];
30 int FORMULATAG[30][10],FORMULAPARAMETER[30][10][6];
31 short PED4[4800];
32 int PEDSHIFT;
33 
35 
36 int unpackbits(char *data, int nbits, int index)
37 {
38  TString a = data;
39  TString v= a(index,nbits);
40  int b = strtol(v.Data(),NULL,2);
41  return b;
42 }
43 void swapline(char*pointer)
44 {
45  char T[16];
46  for(int i=0;i<16;i++) T[i] = pointer[i];
47  pointer[8] = T[4];
48  pointer[9] = T[5];
49  pointer[10] = T[6];
50  pointer[11] = T[7];
51  pointer[12] = T[0];
52  pointer[13] = T[1];
53  pointer[14] = T[2];
54  pointer[15] = T[3];
55 
56  pointer[0] = T[12];
57  pointer[1] = T[13];
58  pointer[2] = T[14];
59  pointer[3] = T[15];
60  pointer[4] = T[8];
61  pointer[5] = T[9];
62  pointer[6] = T[10];
63  pointer[7] = T[11];
64 }
65 void makeString(unsigned char* data,int nb, TString &result)
66 {
67  result = "";
68  for(int i=0;i<nb;i++) for (Int_t j = 7;j >= 0;j--) result += (((short)data[i] & (1 << j)) ? "1" : "0");
69 }
70 void loadTriggerMasks(char* file,int start)
71 {
72  FILE *W = fopen(file,"rb");
73  unsigned char mask[16];
74  for(int dsm=1;dsm<=15;dsm++)
75  {
76  char * pointer = (char*)mask;
77  fread(pointer,(int)sizeof(unsigned char)*16,1,W);
78  swapline(pointer);
79  TString result;
80  makeString((unsigned char*) pointer,16, result);
81  sprintf(BITMASK[dsm-1],"%s",result.Data());
82  }
83  cout <<"Decoding the data "<<endl;
84  for(int patch = 1; patch<=150;patch++)
85  {
86  int dsm = DSM[patch-1+start];
87  int bit = BIT[patch-1+start];
88  int ht = unpackbits((char*)BITMASK[dsm-1],6,128-bit-6);
89  int pa = unpackbits((char*)BITMASK[dsm-1],6,128-bit-12);
90  if(ht==63) HT[patch-1+start] = 1; else HT[patch-1+start] = 0;
91  if(pa==63) PA[patch-1+start] = 1; else PA[patch-1+start] = 0;
92  }
93  fclose(W);
94 }
95 
96 void StOnlineTriggerMonitoring::saveTrigger(const Char_t *TS, Bool_t status, Bool_t pedestal, Bool_t lut, Bool_t saveDB, Bool_t saveTables, const Char_t *tables_dir, const Char_t *saved_dir, const Char_t *bemcStatusCopy, const Char_t *bceTable, const Char_t *bcwTable)
97 {
98  cout << "tables dir = " << tables_dir << endl;
99  cout << "saved dir = " << saved_dir << endl;
100  cout << "bemcStatusCopy = " << bemcStatusCopy << endl;
101  cout << "bceTable = " << bceTable << endl;
102  cout << "bcwTable = " << bcwTable << endl;
103 
104  TString FILENAME;
105 
106  cout << "Saving trigger tables in offline DB for TS = "<< TS <<endl;
107 
108  cout << "Creating StEmcDecoder..." << endl;
109  StEmcDecoder *decoder = new StEmcDecoder();
110  cout << "Decoder created " << decoder << endl;
111 
112  // trigger decoding map
113  // load the files bcw_table.txt and bce_table.txt
114  // used in John Nelson's conv_lut program
115  ifstream inw(bcwTable);
116  for(int i=0;i<150;i++) {
117  inw >> PATCH[i]>>DSM[i]>>BIT[i];
118  //DSM[i] = ((PATCH[i] - 1) / 10) + 1;
119  }
120  inw.close();
121  ifstream ine(bceTable);
122  for(int i=0;i<150;i++) {
123  ine >> PATCH[i+150]>>DSM[i+150]>>BIT[i+150];
124  //DSM[i+150] = ((PATCH[i+150] - 1) / 10) + 1;
125  }
126  ine.close();
127 
128  FILENAME = saved_dir; FILENAME += "/bcw.lut.bin";
129  cout <<"Loading trigger masks from "<<FILENAME.Data()<<endl;
130  loadTriggerMasks((char*)FILENAME.Data(),0);
131  FILENAME = saved_dir; FILENAME += "/bce.lut.bin";
132  cout <<"Loading trigger masks from "<<FILENAME.Data()<<endl;
133  loadTriggerMasks((char*)FILENAME.Data(),150);
134 
135  int NHT=0, NPA=0;
136 
137  for(int i=0;i<300;i++){
138  if(HT[i]==0) cout <<"High Tower "<<i<<" masked out\n";
139  if(PA[i]==0) cout <<"Patch sum "<<i<<" masked out\n";
140  if(HT[i]==0) NHT++;
141  if(PA[i]==0) NPA++;
142  }
143  cout <<"Number of high towers masked out = "<<NHT<<endl;
144  cout <<"Number of trigger patches masked out = "<<NPA<<endl;
145 
146  // reading online pedestals...
147  for(int crate = 1;crate<=30;crate++){
148  FILENAME = saved_dir;
149  FILENAME+="/daq_pedestal_crate0x";
150  char str[10];
151  sprintf(str,"%02x",crate);
152  FILENAME+=str;
153  FILENAME+=".dat";
154 
155  long id,flag,mod;
156  Long64_t size;
157  if(gSystem->GetPathInfo(FILENAME.Data(),&id,&size,&flag,&mod)==0){
158  cout <<FILENAME.Data()<<" is Ok\n";
159  ifstream in(FILENAME.Data());
160  Char_t lineData[300];
161  Int_t towerid,ped4val;
162  float ped, rms;
163  for(int i=0;i<160;i++){
164  in.getline(lineData,300);
165  Int_t nColumns = sscanf(lineData,"%d %f %f %d",&towerid,&ped,&rms,&ped4val);
166  if (nColumns == 3)
167  ped4val = 0;
168  Int_t towerSoftId = 0;
169  if (decoder && decoder->GetTowerIdFromCrate(crate, towerid, towerSoftId))
170  PED4[towerSoftId-1]=(short)ped4val;
171  PED[crate-1][towerid] = (int)(ped*100);
172  PEDRMS[crate-1][towerid] = (int)(rms*100);
173  }
174  in.close();
175  } else {
176  for(int i=0;i<160;i++) {
177  PED[crate-1][i]=0;
178  PEDRMS[crate-1][i]=0;
179  Int_t towSoftId=0;
180  if (decoder && decoder->GetTowerIdFromCrate(crate, i, towSoftId))
181  PED4[towSoftId-1]=0;
182  }
183  }
184  }
185 
186  // reading BemcConfig.dat
187  FILENAME = saved_dir; FILENAME+="/BemcConfig.dat";
188  ifstream bemcConf(FILENAME.Data());
189  PEDSHIFT = 0;
190  char line[4096];
191  while(!bemcConf.eof()){
192  bemcConf.getline(line,4096);
193  //cout << line << endl;
194  TString L = line;
195  if(L.Index("TriggerPedestalShift")>=0){
196  TString b = L(L.Index("TriggerPedestalShift")+21,L.Length());
197  if(b.BeginsWith("0x")) PEDSHIFT = strtol(b.Data(),NULL,16);
198  else PEDSHIFT = atoi(b.Data());
199  PEDSHIFT*=100;
200  }
201  }
202 
203  // reading single tower masks and trigger bit conversion mode
204  for(int crate = 1;crate<=30;crate++){
205  FILENAME = saved_dir; FILENAME+= "/config_crate0x";
206  char str[10];
207  sprintf(str,"%02x",crate);
208  FILENAME+=str;
209  FILENAME+=".dat";
210 
211  long id,flag,mod;
212  Long64_t size;
213  if(gSystem->GetPathInfo(FILENAME.Data(),&id,&size,&flag,&mod)==0){
214  cout <<FILENAME.Data()<<" is Ok\n";
215  ifstream in(FILENAME.Data());
216  char tmp[50];
217  short bit6[2][5],mask[2][5],formula[2][5],par[2][5][6];
218  in >> tmp; // nodeId
219  in >> tmp; // rhic clock latency
220  in >> tmp; // led latency
221  in >> tmp; // led amplitude
222  in >> tmp; // led mask 1
223  in >> tmp; // led mask 2
224  in >> tmp; // pulser delay
225  in >> tmp; // pulser latency
226 
227  for(int board = 1; board<=5;board++){
228  in >> tmp; // fifo latency
229  in >> tmp; // calibration pulser amplitude
230  in >> tmp; // calibration pulser mask 1
231 
232  for(int patch = 0;patch<2;patch++){
233  in >> tmp; // trigger mask 1;
234  TString A1 = tmp;
235  if(A1.BeginsWith("0x")) mask[patch][board-1] = strtol(A1.Data(),NULL,16);
236  else mask[patch][board-1] = atoi(A1.Data());
237 
238  in >> tmp; // formula tag 1
239  TString A11 = tmp;
240  if(A11.BeginsWith("0x")) formula[patch][board-1] = strtol(A11.Data(),NULL,16);
241  else formula[patch][board-1] = atoi(A11.Data());
242 
243  for(int f = 0;f<6;f++){ // formula parameters
244  in >> tmp;
245  TString A12 = tmp;
246  if(A12.BeginsWith("0x")) par[patch][board-1][f] = strtol(A12.Data(),NULL,16);
247  else par[patch][board-1][f] = atoi(A12.Data());
248  }
249 
250  in >> tmp; // high tower 6 bits 4
251  TString A = tmp;
252  if(A.BeginsWith("0x")) bit6[patch][board-1] = strtol(A.Data(),NULL,16);
253  else bit6[patch][board-1] = atoi(A.Data());
254  //cout << "!!!!!! " << bit6[patch][board-1] << endl;
255  }
256  }
257  if (!in.eof()){
258  for(int board = 0; board<=5;board++){
259  in >> tmp; // inrun
260  in >> tmp; // ht
261  if (board >= 1) {
262  Bool_t boardHT = atoi(tmp);
263  if (!boardHT) {
264  cout << "Board " << board << " HT peds not configured" << endl;
265  // zero out pedestals
266  }
267  }
268  in >> tmp; // jp
269  if (board >= 1) {
270  Bool_t boardJP = atoi(tmp);
271  if (!boardJP) {
272  cout << "Board " << board << " LUT not configured" << endl;
273  formula[0][board-1] = 0; // LUT formula = 0
274  formula[1][board-1] = 0; // LUT formula = 0
275  par[0][board-1][0] = 1; // LUT scale = 1
276  par[1][board-1][0] = 1; // LUT scale = 1
277  par[0][board-1][1] = 0; // LUT ped = 0
278  par[1][board-1][1] = 0; // LUT ped = 0
279  par[0][board-1][2] = 0; // LUT sigma = 0
280  par[1][board-1][2] = 0; // LUT sigma = 0
281  par[0][board-1][3] = 1; // LUT powerup = 0
282  par[1][board-1][3] = 1; // LUT powerup = 0
283  par[0][board-1][4] = 0; // LUT par4 = 0
284  par[1][board-1][4] = 0; // LUT par4 = 0
285  par[0][board-1][5] = 0; // LUT par5 = 0
286  par[1][board-1][5] = 0; // LUT par5 = 0
287  }
288  }
289  in >> tmp; // checkconfig
290  in >> tmp; // checkped
291  in >> tmp; // checklut
292  }
293  }
294  for(int i=0;i<160;i++){
295  int board = i/32+1;
296  int channel = i%32;
297  int patch = channel/16;
298  int m = mask[patch][board-1];
299  int bit = channel-16*patch;
300  FORMULATAG[crate-1][i/16] = formula[patch][board-1];
301  for(int p = 0;p<6;p++)
302  FORMULAPARAMETER[crate-1][i/16][p] = par[patch][board-1][p];
303  BITCONV[crate-1][i/16] = bit6[patch][board-1];
304  if( ((m>>bit) & 0x1)==1 ) TOWER[crate-1][i] = 1; else TOWER[crate-1][i] = 0;
305  if(TOWER[crate-1][i] == 0) cout <<" Masked out channel "<<i<<" from crate "<<crate<<endl;
306  }
307  in.close();
308  }
309  else for(int i=0;i<160;i++) { BITCONV[crate-1][i/16]=0; TOWER[crate-1][i]=0;}
310  }
311 
312  // create tables and save them to the database
313  int first=-1;
314  TString TSp = TS;
315  TString timestamp=TSp(first+1,4);
316  timestamp+="-";
317  timestamp+=TSp(first+5,2);
318  timestamp+="-";
319  timestamp+=TSp(first+7,2);
320  timestamp+=" ";
321  timestamp+=TSp(first+10,2);
322  timestamp+=":";
323  timestamp+=TSp(first+12,2);
324  timestamp+=":";
325  timestamp+=TSp(first+14,2);
326  cout <<"TS = "<<TS<<" TimeStamp = "<<timestamp<<endl;
327 
328  int towerData[4800][8];
329  for (int i = 0;i < 4800;i++){
330  for (int j = 0;j < 8;j++){
331  towerData[i][j] = 0;
332  }
333  }
334  cout << "Start writing " << bemcStatusCopy << endl;
335  ofstream bemcStatusStream(bemcStatusCopy);
336  bemcStatusStream << "##################################################################################" << endl;
337  bemcStatusStream << "# This plain text file contains the complete BEMC trigger configuration" << endl;
338  bemcStatusStream << "# Generated by the online BEMC trigger monitoring program on " << gSystem->HostName() << ":" << gSystem->WorkingDirectory() << endl;
339  bemcStatusStream << "# Timestamp: " << timestamp << endl;
340 
341  // Use StEmcDecoder
342  for(int crate = 1;crate <= 30;crate++) {
343  for(int tower = 0;tower < 160;tower++) {
344  int softId;
345  if (decoder && decoder->GetTowerIdFromCrate(crate, tower, softId)) {
346  towerData[softId - 1][0] = TOWER[crate - 1][tower];
347  towerData[softId - 1][3] = PED[crate - 1][tower];
348  towerData[softId - 1][7] = PEDRMS[crate - 1][tower];
349  towerData[softId - 1][4] = crate;
350  towerData[softId - 1][5] = tower;
351  }
352  int triggerPatch;
353  if (decoder && decoder->GetTriggerPatchFromCrate(crate, tower, triggerPatch)) {
354  towerData[softId - 1][6] = triggerPatch;
355  towerData[softId - 1][1] = HT[triggerPatch];
356  towerData[softId - 1][2] = PA[triggerPatch];
357  }
358  }
359  }
360  bemcStatusStream << "#" << endl;
361  bemcStatusStream << "# SoftId\tCrate\tCrate seq\tTower unmasked?\tPatch unmasked in HT?\tPatch unmasked in sum?\tPedestal\ttriggerPatch" << endl;
362  for (int i = 0;i < 4800;i++) {
363  bemcStatusStream << "SoftId " << (i+1) << "\t"
364  << towerData[i][4] << "\t"
365  << towerData[i][5] << "\t"
366  << towerData[i][0] << "\t"
367  << towerData[i][1] << "\t"
368  << towerData[i][2] << "\t"
369  << (Float_t(towerData[i][3]) / 100.0) << "\t"
370  << towerData[i][6] << endl;
371  }
372  bemcStatusStream << "#" << endl;
373  bemcStatusStream << "TriggerPedestalShift " << (float(PEDSHIFT)/100.0) << endl;
374  bemcStatusStream << "#" << endl;
375  bemcStatusStream << "# triggerPatch\tCrate\tCrate patch\tUnmasked in HT?\tUnmasked in sum?\tBit conversion mode\tLUT formula and parameters" << endl;
376  for(int crate = 1;crate <= 30;crate++) {
377  for(int patch = 0;patch < 10;patch++) {
378  int triggerPatch;
379  if (decoder->GetTriggerPatchFromCrate(crate, patch*16, triggerPatch)) {
380  bemcStatusStream << "triggerPatch " << triggerPatch << "\t" << crate << "\t" << patch << "\t";
381  bemcStatusStream << HT[triggerPatch] << "\t";
382  bemcStatusStream << PA[triggerPatch] << "\t";
383  bemcStatusStream << BITCONV[crate-1][patch] << "\t";
384  bemcStatusStream << FORMULATAG[crate-1][patch] << "\t";
385  bemcStatusStream << FORMULAPARAMETER[crate-1][patch][0] << "\t";
386  bemcStatusStream << FORMULAPARAMETER[crate-1][patch][1] << "\t";
387  bemcStatusStream << FORMULAPARAMETER[crate-1][patch][2] << "\t";
388  bemcStatusStream << FORMULAPARAMETER[crate-1][patch][3] << "\t";
389  bemcStatusStream << FORMULAPARAMETER[crate-1][patch][4] << "\t";
390  bemcStatusStream << FORMULAPARAMETER[crate-1][patch][5];
391  bemcStatusStream << endl;
392  }
393  }
394  }
395 
396  cout << "Deleting decoder " << decoder << endl;
397  if (decoder) delete decoder; decoder = 0;
398  cout << "Decoder deleted " << decoder << endl;
399 
400  bemcStatusStream << "# End of file" << endl;
401  bemcStatusStream << "##################################################################################" << endl;
402  bemcStatusStream.close();
403  cout << "Finished writing " << bemcStatusCopy << endl;
404 
405  cout << "Started creating tables" << endl;
406  St_emcTriggerPed *pedestals_t = new St_emcTriggerPed("bemcTriggerPed",1);
407  St_bemcTriggerPed4 *ped4_t = new St_bemcTriggerPed4("bemcTriggerPed4",1);
408  St_emcTriggerStatus *status_t = new St_emcTriggerStatus("bemcTriggerStatus",1);
409  St_emcTriggerLUT *lut_t = new St_emcTriggerLUT("bemcTriggerLUT",1);
410  emcTriggerPed_st* pedestals_st = pedestals_t ? pedestals_t->GetTable() : 0;
411  bemcTriggerPed4_st* ped4_st = ped4_t ? ped4_t->GetTable() : 0;
412  emcTriggerStatus_st* status_st = status_t ? status_t->GetTable() : 0;
413  emcTriggerLUT_st* lut_st = lut_t ? lut_t->GetTable() : 0;
414  cout << "Finished creating tables" << endl;
415 
416  cout << "Started filling tables" << endl;
417  if (pedestals_st) pedestals_st->PedShift = PEDSHIFT;
418  for(int crate = 1;crate<=30;crate++) {
419  for(int patch =0;patch<10;patch++) {
420  if (pedestals_st) pedestals_st->BitConversionMode[crate-1][patch] = BITCONV[crate-1][patch];
421  if (lut_st) {
422  lut_st->FormulaTag[crate-1][patch] = FORMULATAG[crate-1][patch];
423  lut_st->FormulaParameter0[crate-1][patch] = FORMULAPARAMETER[crate-1][patch][0];
424  lut_st->FormulaParameter1[crate-1][patch] = FORMULAPARAMETER[crate-1][patch][1];
425  lut_st->FormulaParameter2[crate-1][patch] = FORMULAPARAMETER[crate-1][patch][2];
426  lut_st->FormulaParameter3[crate-1][patch] = FORMULAPARAMETER[crate-1][patch][3];
427  lut_st->FormulaParameter4[crate-1][patch] = FORMULAPARAMETER[crate-1][patch][4];
428  lut_st->FormulaParameter5[crate-1][patch] = FORMULAPARAMETER[crate-1][patch][5];
429  }
430  }
431  for(int tower =0;tower<160;tower++) {
432  if (pedestals_st) pedestals_st->Ped[crate-1][tower]=PED[crate-1][tower];
433  if (status_st) status_st->TowerStatus[crate-1][tower]=TOWER[crate-1][tower];
434  }
435  }
436  cout << "... filling tables" << endl;
437  for(int patch=0;patch<300;patch++) {
438  if (status_st) {
439  status_st->PatchStatus[patch]=PA[patch];
440  status_st->HighTowerStatus[patch]=HT[patch];
441  }
442  }
443 
444  for (int i = 0;i < 4800;i++)
445  if (ped4_st) ped4_st->Ped4[i]=PED4[i];
446 
447  cout << "Finished filling tables" << endl;
448  cout << "Creating StBemcTablesWriter ..." << endl;
449  StBemcTablesWriter writer;
450  cout << "Created StBemcTablesWriter" << endl;
451  cout << "Loading tables ..." << endl;
452  writer.loadTables(timestamp.Data());
453  cout << "Loaded tables" << endl;
454 
455  if(status && status_st) {
456  cout << "Setting bemcTriggerStatus table " << status_st << endl;
457  writer.setTable("bemcTriggerStatus", status_st);
458  if(saveDB) {
459  LOG_INFO << "Start uploading table bemcTriggerStatus" << endm;
460  writer.writeToDb("bemcTriggerStatus", timestamp.Data());
461  LOG_INFO << "Finished uploading table bemcTriggerStatus" << endm;
462  }
463  if(saveTables) {
464  FILENAME = tables_dir; FILENAME += "/bemcTriggerStatus."; FILENAME+=TS; FILENAME+=".root";
465  LOG_INFO << "Start saving table " << FILENAME << endm;
466  writer.writeToFile(FILENAME.Data());
467  LOG_INFO << "Finished saving table " << FILENAME << endm;
468  }
469  }
470 
471  if(pedestal && pedestals_st) {
472  cout << "Setting bemcTriggerPed table " << pedestals_st << endl;
473  writer.setTable("bemcTriggerPed", pedestals_st);
474  if(saveDB) {
475  LOG_INFO << "Start uploading table bemcTriggerPed" << endm;
476  writer.writeToDb("bemcTriggerPed", timestamp.Data());
477  LOG_INFO << "Finished uploading table bemcTriggerPed" << endm;
478  }
479  if(saveTables) {
480  FILENAME = tables_dir; FILENAME += "/bemcTriggerPed."; FILENAME+=TS; FILENAME+=".root";
481  LOG_INFO << "Start saving table " << FILENAME << endm;
482  writer.writeToFile(FILENAME.Data());
483  LOG_INFO << "Finished saving table " << FILENAME << endm;
484  }
485  }
486 
487  if(pedestal && ped4_st) {
488  cout << "Setting bemcTriggerPed4 table " << ped4_st << endl;
489  writer.setTable("bemcTriggerPed4", ped4_st);
490  if(saveDB) {
491  LOG_INFO << "Start uploading table bemcTriggerPed4" << endm;
492  writer.writeToDb("bemcTriggerPed4", timestamp.Data());
493  LOG_INFO << "Finished uploading table bemcTriggerPed4" << endm;
494  }
495  if(saveTables) {
496  FILENAME = tables_dir; FILENAME += "/bemcTriggerPed4."; FILENAME+=TS; FILENAME+=".root";
497  LOG_INFO << "Start saving table " << FILENAME << endm;
498  writer.writeToFile(FILENAME.Data());
499  LOG_INFO << "Finished saving table " << FILENAME << endm;
500  }
501  }
502  if(lut && lut_st) {
503  cout << "Setting bemcTriggerLUT table " << lut_st << endl;
504  writer.setTable("bemcTriggerLUT", lut_st);
505  if(saveDB) {
506  LOG_INFO << "Start uploading table bemcTriggerLUT" << endm;
507  writer.writeToDb("bemcTriggerLUT", timestamp.Data());
508  LOG_INFO << "Finished uploading table bemcTriggerLUT" << endm;
509  }
510  if(saveTables) {
511  FILENAME = tables_dir; FILENAME += "/bemcTriggerLUT."; FILENAME+=TS; FILENAME+=".root";
512  LOG_INFO << "Start saving table " << FILENAME << endm;
513  writer.writeToFile(FILENAME.Data());
514  LOG_INFO << "Finished saving table " << FILENAME << endm;
515  }
516  }
517 }
int GetTriggerPatchFromCrate(int crate, int sequence, int &patchId) const
returns the trigger patch from crate and sequence in the crate
Definition: DSM.hh:16
void loadTables(const char *sqlTime, const char *flavor="ofl")
load directly from DB, no Maker needed
int GetTowerIdFromCrate(int crate, int sequence, int &softId) const
Get Software Id from Crate number and position in crate for towers.