#include "daqMainFrame.hh" #include "daqmon.hh" //#include #include #include #include "hist_lib.hh" #include #include daqPad* pad_find(const char *name, daqTab* tab); daqPad* pad_find_id(int id, daqTab* tab); //------------------------- //--- monitor GLobals --- //------------------------- struct timeval tvA[10], tvB[10]; daqMainFrame *dmf; TCanvas *c1,*c2,*c3,*c4; int HIST_UPDATED=0; int SHOW_TAB=0; //extern int button_EXIT,button_PAUSE; int button_EXIT=0,button_PAUSE=0,button_SAVE=0; //vector hids; TH1 *hRunInfo=NULL; daqPad *pad; daqTab *tab; vector tabs; //vector > *tabs; //--------------------- root client test ------------------------------ extern int CurrentTAB; int CurrentTAB=0; int tabBCALr=-1,tabBCALp=-1,tabBCALs=-1,tabFCALr=-1,tabFCALp=-1,tabTOFr=-1,tabSTPSCr=-1,tabTRIGr=-1,tabTAGr=-1,tabTAGd=-1; TList *ALL_1D_HIST; TList *ALL_2D_HIST; TList *ALL_GH_HIST; //============================================================================== // signal handlers //============================================================================== int sig_int=0, sig_hup=0, sig_alarm=0, sig_pipe=0, sig_term=0, sig_kill=0 ; // void ctrl_c(int m) { sig_int=1; printf("\n CTRL-C pressed...\n"); } void fpipe(int m) { sig_pipe=1; printf("\n SIgnal SIGPIPE ...\n"); } void fchld(int m) { sig_term=1; printf(" *** SIG CHLD *** \n"); } void fabrt(int m) { sig_term=1; printf(" *** SIG ABRT *** \n"); } void fquit(int m) { sig_term=1; printf(" *** SIG QUIT *** \n"); } void fstop(int m) { sig_term=1; printf(" *** SIG STOP *** \n"); } void fskill(int m) { sig_term=1; printf(" *** SIG KILL *** \n"); } void fsterm(int m) { sig_term=1; printf(" *** SIG TERM *** \n"); } void falarm(int m) { sig_alarm=1; printf(" *** ALARM *** \n"); } void hungup(int m) { sig_hup++; printf("\n Signal HUP received sig_hup=%d\n\r",sig_hup); if (!(sig_hup%2)) printf(" STOP printout \n\r"); } //============================================================================== // M A I N //============================================================================== int main() { int npad; /*--------------------------------------*/ signal(SIGPIPE,fpipe); signal(SIGINT,ctrl_c); signal(SIGTERM,fsterm); signal(SIGKILL,fskill); signal(SIGSTOP,fstop); signal(SIGALRM,falarm); signal(SIGHUP,hungup); signal(SIGQUIT,fquit); signal(SIGABRT,fabrt); //signal(SIGCHLD,fchld); /*--------------------------------------*/ TApplication theApp("App", NULL, NULL); //--- Create Main Frame --- dmf = new daqMainFrame(gClient->GetRoot(), 900, 700); dmf->Connect("CloseWindow()", "MainFrame", dmf, "CloseWindow()"); ALL_GH_HIST=new TList(); TGraph* gr; //------------------------------------------------------------------------ //--- Create Tabs --- //------------------------------------------------------------------------ char hist_name[256]; //daqPad(char* hname, int pad, int dim, int Log, int stat, char* hopt, char* dopt); //------------------------------ //---- tab: TRIGGER --- //------------------------------ tab=new daqTab(dmf,"Trigger",2,3); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tabTRIGr=tab->ID; pad = new daqPad("roctrig1:RunInfo",1,2,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("iocpulser1:DISCR_Scalers",2,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("iocpulser2:DISCR_Scalers",3,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; //tab->canvas->cd(3); gPad->AddExec("rate_dsc",".x rate_dsc.C++"); pad = new daqPad("ioctagctrl:DISCR_Scalers",4,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; // graph Cosmic pad = new daqPad("Trig1:Cosmic",5,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,3,5,1); tab->canvas->cd(4); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); // graph pad = new daqPad("Trig1:Rate_3",6,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,3,5,4); tab->canvas->cd(6); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //------------------------------ //---- tab: DAQ 1 --- //------------------------------ tab=new daqTab(dmf,"DAQ1",8,7); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=10; npad=0; double tsize=0.14; pad = new daqPad("roctof1:EventSize",++npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2; pad = new daqPad("rocst:EventSize",++npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("roctagm1:EventSize",++npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("roctagh1:EventSize",++npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocstpsc1:EventSize",++npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocps1:EventSize",++npad,2,0,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocps2:EventSize",++npad,2,0,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocdirc:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad->MColor=3; //-- Misc x8 for (int ii=1; ii<=12; ii++) { if (ii==1 || ii==4) continue; npad++; //-- FDC x10 //if (ii==1) continue; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfdc%d:EventSize",ii); pad = new daqPad(hist_name,npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; } for (int ii=1; ii<=4; ii++) { npad++; //-- CDC x4 if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"roccdc%d:EventSize",ii); pad = new daqPad(hist_name,npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; } int bcal_fadc[] = {1,2,4,5,7,8,10,11}; for (int i=0; i<8; i++) { int ii=bcal_fadc[i]; npad++; //-- BCAL x8 if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:EventSize",ii); pad = new daqPad(hist_name,npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad->LSize=tsize/2.; } for (int ii=1; ii<=12; ii++) { npad++; //-- FCAL x12 if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:EventSize",ii); pad = new daqPad(hist_name,npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; } pad = new daqPad("roctof2:EventSize",++npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("roctagmh:EventSize",++npad,1,1,1,"nemo","hist"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; // F1TDC pad = new daqPad("rocfdc1:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocfdc4:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocfdc13:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocfdc14:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; // BCAL pad = new daqPad("rocbcal3:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocbcal6:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocbcal9:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocbcal12:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; //-- TDC x10 // MISC pad = new daqPad("roctrd1:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocfmwpc1:EventSize",++npad,1,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; //-- total = 51 //------------------------------ //---- tab: DAQ 2 --- //------------------------------ tab=new daqTab(dmf,"DAQ2",8,7); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=10; npad=0; tsize=0.14; pad = new daqPad("roctof1:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocst:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("roctagm1:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("roctagh1:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocstpsc1:size2time",++npad,2,1,1,"neuo ","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocps1:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocps2:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocdirc:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; for (int ii=1; ii<=12; ii++) { if (ii==1 || ii==4) continue; npad++; //if (ii==1 ) continue; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfdc%d:size2time",ii); pad = new daqPad(hist_name,npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; } for (int ii=1; ii<=4; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"roccdc%d:size2time",ii); pad = new daqPad(hist_name,npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; } for (int i=0; i<8; i++) { int ii=bcal_fadc[i]; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:size2time",ii); pad = new daqPad(hist_name,npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; } for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:size2time",ii); pad = new daqPad(hist_name,npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; } pad = new daqPad("roctof2:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("roctagmh:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; // TDC pad = new daqPad("rocfdc1:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocfdc4:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocfdc13:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocfdc14:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; // BCAL pad = new daqPad("rocbcal3:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocbcal6:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocbcal9:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("rocbcal12:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; // MISC pad = new daqPad("rocfmwpc1:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; pad = new daqPad("roctrd1:size2time",++npad,2,1,1,"neuo","colz"); tab->pads.push_back(pad); pad->TSize=tsize; pad->LSize=tsize/2.; //--------------------------------- //---- tab: RF --- //--------------------------------- tab=new daqTab(dmf,"RF",2,2); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=5; pad = new daqPad("rocfdc1:F1TDC_RF",1,1,1,1,"neuomr","hist"); tab->pads.push_back(pad); pad->TSize=0.05; pad = new daqPad("rocstpsc1:F1TDC_RF",2,1,1,1,"neuomr","hist"); tab->pads.push_back(pad); pad->TSize=0.05; pad = new daqPad("roctagmh:F1TDC_RF",3,1,1,1,"neuomr","hist"); tab->pads.push_back(pad); pad->TSize=0.05; pad = new daqPad("roctof2:F1TDC_RF",4,1,1,1,"neuomr","hist"); tab->pads.push_back(pad); pad->TSize=0.05; //--------------------------------- //---- tab: TOF Profile 2D --- //--------------------------------- /* tab=new daqTab(dmf,"TOFpc",4,3); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=5; pad = new daqPad("roctof1:F250_2Dadc:03" ,1,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:04" ,2,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:05" ,3,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:06" ,4,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:07" ,5,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:08" ,6,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:09" ,7,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:10" ,8,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:13" ,9,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:14" ,10,2,0,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_2Dadc:15" ,11,2,0,0,"ne","colz"); tab->pads.push_back(pad); */ //--------------------------------------- //---- tab: TOF DISCR & FADC rates --- //--------------------------------------- tab=new daqTab(dmf,"TOFr",3,3); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=5; tabTOFr=tab->ID; pad = new daqPad("roctof3:DISCR_Scalers",1,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("roctof1:F250_Scalers",2,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(2); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("roctof1:F250_pulse",3,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("roctof1:F250_time",4,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("roctof1:F250_profadc" ,5,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; pad->Marker=20; pad->MColor=2; pad->MSize=0.5; tab->canvas->cd(5); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); //pad = new daqPad("roctof1:F250_adc:03:02",2,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad = new daqPad("roctof1:F250_Fit_s:0",6,1,0,1,"neuo","p9hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad->Marker=20; pad->MColor=2; pad->MSize=0.5; //tab->canvas->cd(3); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("roctof1:F250_Fit_m:1",6,1,0,1,"neuo","P9same"); tab->pads.push_back(pad); pad->Marker=20; pad->MColor=4; pad->MSize=0.5; //tab->canvas->cd(4); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("roctof1:F250_Fit_s:1",6,1,0,1,"neuo","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; //tab->canvas->cd(5); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("roctof2:CAEN_TDC_prof",7,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("roctof2:CTDC_occ2D",8,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(8); gPad->SetGridy(1); gPad->AddExec("ctdc",".x ctdc.C"); pad = new daqPad("roctof2:Caen_TDC:04:26",9,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; // debug adc //pad = new daqPad("roctof1:F250_adc_all:03:03",9,1,0,1,"neuo","hist"); tab->pads.push_back(pad); //------------------------------ //---- tab: MUON Profile --- //------------------------------ tab=new daqTab(dmf,"Muon",3,4); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; npad=0; pad = new daqPad("rocfmwpc1:F125_pedestals",++npad,1,1,0," ","p9colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); sprintf(hist_name,"rocfmwpc1:F125_Fit_s:0"); pad = new daqPad(hist_name,++npad,1,0,0," ","p9hist"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.07; sprintf(hist_name,"rocfmwpc1:F125_Fit_m:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.07; sprintf(hist_name,"rocfmwpc1:F125_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.07; pad = new daqPad("rocfmwpc1:DISCR_Scalers",++npad,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; //pad = new daqPad("rocfmwpc1:F250_Scalers",++npad,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("rocfmwpc1:F250_profadc" ,++npad,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; pad->Marker=20; pad->MColor=2; pad->MSize=0.5; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocfmwpc1:F250_Fit_s:0",++npad,1,0,1,"neuo","p9hist"); tab->pads.push_back(pad); pad->Marker=20; pad->MColor=2; pad->MSize=0.5; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocfmwpc1:F250_Fit_m:1",npad,1,0,1,"neuo","P9same"); tab->pads.push_back(pad); pad->Marker=20; pad->MColor=4; pad->MSize=0.5; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocfmwpc1:F250_Fit_s:1",npad,1,0,1,"neuo","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); sprintf(hist_name,"rocfmwpc1:F125_pulse"); pad = new daqPad(hist_name,++npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; sprintf(hist_name,"rocfmwpc1:F125_time"); pad = new daqPad(hist_name,++npad,1,0,1,"euo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("rocfmwpc1:F125_adc:14:02",++npad,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("rocfmwpc1:F250_pulse",++npad,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("rocfmwpc1:F250_time",++npad,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad->TSize=0.07; // graph pad = new daqPad("Trig1:Rate_3",++npad,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,3,14,2); tab->canvas->cd(npad); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); exit(1); } //------------------------------ //---- tab: TRD Profile --- //------------------------------ tab=new daqTab(dmf,"TRD",3,3); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; npad=0; for (int ii=1; ii<=1; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } //sprintf(hist_name,"rocst%d:F125_pedestals",ii); sprintf(hist_name,"roctrd1:F125_pedestals"); pad = new daqPad(hist_name,npad,2,1,0," ","p9colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); } for (int ii=1; ii<=1; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } //sprintf(hist_name,"rocst%d:F125_Fit_s:0",ii); sprintf(hist_name,"roctrd1:F125_Fit_s:0"); pad = new daqPad(hist_name,npad,1,0,0," ","p9hist"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.07; //sprintf(hist_name,"rocst%d:F125_Fit_m:1",ii); sprintf(hist_name,"roctrd1:F125_Fit_m:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.07; //sprintf(hist_name,"rocst%d:F125_Fit_s:1",ii); sprintf(hist_name,"roctrd1:F125_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.07; } npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); } sprintf(hist_name,"roctrd1:F125_pulse"); pad = new daqPad(hist_name,npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; // row 2 npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); } sprintf(hist_name,"roctrd1:F125_wpulse"); pad = new daqPad(hist_name,npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); } sprintf(hist_name,"roctrd1:F125_gpulse"); pad = new daqPad(hist_name,npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); } sprintf(hist_name,"roctrd1:F125_time"); pad = new daqPad(hist_name,npad,1,0,1,"euo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; // row 3 npad++; pad = new daqPad("roctrd1:F125_fe55",npad,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; pad = new daqPad("roctrd1:F125_gem",npad,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; pad = new daqPad("roctrd1:F125_gtime",npad,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); } //------------------------------ //---- tab: TRD ADC --- //------------------------------ tab=new daqTab(dmf,"TRDa",4,2); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; pad = new daqPad("roctrd1:F125_2D:03" ,1,2,1,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctrd1:F125_2D:04" ,2,2,1,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctrd1:F125_2D:05" ,3,2,1,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctrd1:F125_2D:06" ,4,2,1,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctrd1:F125_2D:07" ,5,2,1,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctrd1:F125_2D:08" ,6,2,1,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctrd1:F125_2D:09" ,7,2,1,0,"ne","colz"); tab->pads.push_back(pad); pad = new daqPad("roctrd1:F125_2D:10" ,8,2,1,0,"ne","colz"); tab->pads.push_back(pad); //------------------------------ //---- tab: DIRC scalers --- //------------------------------ tab=new daqTab(dmf,"DIRC",1,1); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; npad=0; pad = new daqPad("rocdirc:DIRC_Scalers",1,2,1,0," ","colz"); tab->pads.push_back(pad); //pad->TSize=0.06; //------------------------------ //---- tab: DIRC data --- //------------------------------ tab=new daqTab(dmf,"DIRCd",1,1); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; npad=0; pad = new daqPad("rocdirc:DIRC_Data",1,2,1,0," ","text"); tab->pads.push_back(pad); //pad->TSize=0.06; tab->canvas->cd(1); gPad->SetGridx(1); //------------------------------ //---- tab: FDC TDC --- //------------------------------ tab=new daqTab(dmf,"FDCt",2,3); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; pad = new daqPad("rocfdc1:F1TDC_occ2D",1,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(1); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); pad = new daqPad("rocfdc4:F1TDC_occ2D",2,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(2); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); pad = new daqPad("rocfdc13:F1TDC_occ2D",3,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(3); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); pad = new daqPad("rocfdc14:F1TDC_occ2D",4,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(4); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); //------------------------------ //---- tab: FDC Profile --- //------------------------------ tab=new daqTab(dmf,"FDCp",4,5); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=5; npad=0; for (int ii=1; ii<=12; ii++) { if (ii==1 || ii==4) continue; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfdc%d:F125_pedestals",ii); pad = new daqPad(hist_name,npad,2,1,0," ","p9colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); } for (int ii=1; ii<=12; ii++) { if (ii==1 || ii==4) continue; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfdc%d:F125_Fit_s:0",ii); pad = new daqPad(hist_name,npad,1,0,0," ","p9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocfdc%d:F125_Fit_m:1",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocfdc%d:F125_Fit_s:1",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; } //pad = new daqPad("rocfdc1:F125_adc:04:02",++npad,1,0,1,"neuo","hist"); tab->pads.push_back(pad); //pad = new daqPad("rocfdc2:F125_adc:05:02",++npad,1,0,1,"neuo","hist"); tab->pads.push_back(pad); //------------------------------ //---- tab: FDC pusle shape --- //------------------------------ tab=new daqTab(dmf,"FDCs",4,5); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; npad=0; for (int ii=1; ii<=12; ii++) { if (ii==1 || ii==4) continue; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfdc%d:F125_pulse",ii); pad = new daqPad(hist_name,npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfdc%d:F125_time",ii); pad = new daqPad(hist_name,npad,1,0,1,"euo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; } //daqPad(char* hname, int pad, int dim, int Log, int stat, char* hopt, char* dopt); //------------------------------ //---- tab: CDC Pulse shape --- //------------------------------ tab=new daqTab(dmf,"CDCs",3,4); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; npad=0; for (int ii=1; ii<=4; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"roccdc%d:F125_pulse",ii); pad = new daqPad(hist_name,npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"roccdc%d:F125_time",ii); pad = new daqPad(hist_name,npad,1,0,1,"euo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"roccdc%d:F125_stime",ii); pad = new daqPad(hist_name,npad,1,0,1,"euo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; } //------------------------------ //---- tab: CDC Profile --- //------------------------------ tab=new daqTab(dmf,"CDCp",2,5); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=5; npad=0; for (int ii=1; ii<=4; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"roccdc%d:F125_pedestals",ii); pad = new daqPad(hist_name,npad,2,1,0," ","p9colz"); tab->pads.push_back(pad); pad->TSize=0.07; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); } for (int ii=1; ii<=4; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"roccdc%d:F125_Fit_s:0",ii); pad = new daqPad(hist_name,npad,1,0,0," ","p9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"roccdc%d:F125_Fit_m:1",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"roccdc%d:F125_Fit_s:1",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f125",".x f125.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; } pad = new daqPad("roccdc1:F125_adc:04:02",9,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; pad = new daqPad("roccdc1:F125_tdc:04:02",10,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; //------------------------------ //---- tab: BCAL F1TDC --- //------------------------------ tab=new daqTab(dmf,"BCALt",4,3); tabs.push_back(tab); tab->update_time=2; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tabTOFr=tab->ID; pad = new daqPad("rocbcal3:F1TDC_occ2D",1,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; tab->canvas->cd(1); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); pad = new daqPad("rocbcal6:F1TDC_occ2D",2,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; tab->canvas->cd(2); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); pad = new daqPad("rocbcal9:F1TDC_occ2D",3,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; tab->canvas->cd(3); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); pad = new daqPad("rocbcal12:F1TDC_occ2D",4,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; tab->canvas->cd(4); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); pad = new daqPad("rocbcal13:DISCR_Scalers",5,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; pad = new daqPad("rocbcal14:DISCR_Scalers",6,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; pad = new daqPad("rocbcal15:DISCR_Scalers",7,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; pad = new daqPad("rocbcal16:DISCR_Scalers",8,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.05; //pad = new daqPad("rocbcal9:F1TDC_prof" ,5,1,0,1," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; //pad = new daqPad("rocbcal9:F1TDC_occup",6,1,0,1,"ne","pe"); tab->pads.push_back(pad); pad->TSize=0.06; //pad = new daqPad("rocbcal9:F1TDC:03:09",7,1,0,1,"neuo","hist"); tab->pads.push_back(pad); pad->TSize=0.06; // graph pad = new daqPad("bcal13:DISCR_Rate_0",9,1,0,0," ","colz"); tab->pads.push_back(pad); //pad->TSize=0.01; gr = pad->timeGraph("dummy",600,5,5,6); tab->canvas->cd(5); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); // graph pad = new daqPad("bcal14:DISCR_Rate_0",10,1,0,0," ","colz"); tab->pads.push_back(pad); //pad->TSize=0.01; gr = pad->timeGraph("dummy",600,6,6,7); tab->canvas->cd(6); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); // graph pad = new daqPad("bcal15:DISCR_Rate_0",11,1,0,0," ","colz"); tab->pads.push_back(pad); //pad->TSize=0.01; gr = pad->timeGraph("dummy",600,7,9,10); tab->canvas->cd(7); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); // graph pad = new daqPad("bcal16:DISCR_Rate_0",12,1,0,0," ","colz"); tab->pads.push_back(pad); //pad->TSize=0.01; gr = pad->timeGraph("dummy",600,8,11,12); tab->canvas->cd(8); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //------------------------------ //---- tab: BCAL rates --- //------------------------------ tab=new daqTab(dmf,"BCALr",3,3); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tabBCALr=tab->ID; //daqPad(char* hname, int pad, int dim, int Log, int stat, char* hopt, char* dopt); pad = new daqPad("rocbcal1:F250_Scalers",1,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(1); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocbcal2:F250_Scalers",2,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(2); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocbcal4:F250_Scalers",3,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(3); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocbcal5:F250_Scalers",4,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(4); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocbcal7:F250_Scalers",5,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(5); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocbcal8:F250_Scalers",6,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(6); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocbcal10:F250_Scalers",7,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(7); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocbcal11:F250_Scalers",8,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(8); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocccal:F250_Scalers",9,2,1,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.06; tab->canvas->cd(9); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); //------------------------------ //---- tab: BCAL pulse shape --- //------------------------------ tab=new daqTab(dmf,"BCALs",4,4); tabs.push_back(tab); tab->update_time=1; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tabBCALs=tab->ID; //int bcal_fadc[] = {1,2,4,5,7,8,10,11}; npad=0; for (int i=0; i<8; i++) { int ii=bcal_fadc[i]; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:F250_pulse",ii); pad = new daqPad(hist_name,npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.07; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:F250_time",ii); pad = new daqPad(hist_name,npad,1,0,1,"euo","hist"); tab->pads.push_back(pad); pad->TSize=0.07; } //------------------------------ //---- tab: BCAL adc profile --- //------------------------------ tab=new daqTab(dmf,"BCALp",3,6); tabs.push_back(tab); tab->update_time=5; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tabBCALp=tab->ID; //daqPad(char* hname, int pad, int dim, int Log, int stat, char* hopt, char* dopt); npad=0; for (int i=0; i<9; i++) { int ii=bcal_fadc[i]; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:F250_profadc",ii); if(i==8) sprintf(hist_name,"rocccal:F250_profadc"); pad = new daqPad(hist_name,npad,2,1,0," "," "); tab->pads.push_back(pad); pad->TSize=0.1; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); } //npad++; for (int i=0; i<8; i++) { int ii=bcal_fadc[i]; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:F250_Fit_s:0",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocbcal%d:F250_Fit_m:1",ii); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocbcal%d:F250_Fit_s:1",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; } npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); } sprintf(hist_name,"rocccal:F250_Fit_s:0"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocccal:F250_Fit_m:1"); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocccal:F250_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; //------------------------------ //---- tab: BCAL ped profile --- //------------------------------ tab=new daqTab(dmf,"BCALm",3,6); tabs.push_back(tab); tab->update_time=5; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tabBCALp=tab->ID; //daqPad(char* hname, int pad, int dim, int Log, int stat, char* hopt, char* dopt); npad=0; for (int i=0; i<9; i++) { int ii=bcal_fadc[i]; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:F250_pedestals",ii); if (i==8) sprintf(hist_name,"rocccal:F250_pedestals"); pad = new daqPad(hist_name,npad,2,1,0," "," "); tab->pads.push_back(pad); pad->TSize=0.1; tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250ped",".x f250ped.C"); } //npad++; for (int i=0; i<9; i++) { int ii=bcal_fadc[i]; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocbcal%d:F250_pedmean",ii); if (i==8) sprintf(hist_name,"rocccal:F250_pedmean"); tab->canvas->cd(npad); pad = new daqPad(hist_name,npad,1,1,1,"neuo","hist"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.1; } //------------------------------ //---- tab: FCAL rates --- //------------------------------ /* tab=new daqTab(dmf,"FCALr",4,3); tabs.push_back(tab); tabFCALr=tab->ID; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); npad=0; for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_Scalers",ii); pad = new daqPad(hist_name,ii,2,1,0," ","colz"); tab->pads.push_back(pad); } */ //------------------------------ //---- tab: FCAL graphs --- //------------------------------ tab=new daqTab(dmf,"FCALg",4,6); tabs.push_back(tab); tabFCALr=tab->ID; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); npad=0; for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_Scalers",ii); // pad = new daqPad(hist_name,ii,2,0,0," ","lego2"); tab->pads.push_back(pad); pad->ZSize=0.07; pad = new daqPad(hist_name,ii,2,0,0," ","colz"); tab->pads.push_back(pad); pad->TSize=0.1; pad->LSize=0.08; tab->canvas->cd(npad); gPad->AddExec("f250",".x f250.C"); } //--- graph -- pad = new daqPad("FCAL5_2_0",13,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,5,3,14); tab->canvas->cd(13); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL2_0_2",14,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,2,3,5); tab->canvas->cd(14); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL11_-2_0",15,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,11,3,3); tab->canvas->cd(15); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL8_0_-2",16,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,8,3,12); tab->canvas->cd(16); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //----------------------------------------- //--- graph -- pad = new daqPad("FCAL5_16_0",17,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,5,9,16); tab->canvas->cd(17); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL2_0_16",18,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,2,9,13); tab->canvas->cd(18); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL11_-16_0",19,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,11,9,1); tab->canvas->cd(19); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL8_0_-16",20,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,8,9,4); tab->canvas->cd(20); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //----------------------------------------- //--- graph -- pad = new daqPad("FCAL6_29_0",21,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,6,3,3); tab->canvas->cd(21); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL4_TAC",22,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,4,20,1); tab->canvas->cd(22); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL7_-29_0",23,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,7,3,3); tab->canvas->cd(23); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //--- graph -- pad = new daqPad("FCAL9_0_-29",24,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,9,3,3); tab->canvas->cd(24); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //----------------------------------------- /* 1st row 1st col: (2 , 0) RocFCAL: 5 Slot: 3 Channel: 13 2nd col: (0 , 2) RocFCAL: 2 Slot: 3 Channel: 4 3rd col: (-2, 0) RocFCAL: 11 Slot: 3 Channel: 2 4th col: (0 ,-2) RocFCAL: 8 Slot: 3 Channel: 11 2nd row 1st col: (16 , 0) RocFCAL: 5 Slot: 9 Channel: 15 2nd col: (0 , 16) RocFCAL: 2 Slot: 9 Channel: 12 3rd col: (-16, 0) RocFCAL: 11 Slot: 9 Channel: 0 4th col: (0 ,-16) RocFCAL: 8 Slot: 9 Channel: 3 3rd row 1st col: (29 , 0) RocFCAL: 6 Slot: 3 Channel: 2 2nd col: (0 , 29) RocFCAL: 4 Slot: 3 Channel: 2 3rd col: (-29, 0) RocFCAL: 7 Slot: 3 Channel: 2 4th col: (0 ,-29) RocFCAL: 9 Slot: 3 Channel: 2 */ //------------------------------ //---- tab: FCAL adc profile --- //------------------------------ tab=new daqTab(dmf,"FCALp",4,6); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=10; npad=0; for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_profadc",ii); pad = new daqPad(hist_name,ii,2,1,0," "," "); tab->pads.push_back(pad); pad->TSize=0.1; tab->canvas->cd(ii); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); } for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_Fit_s:0",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocfcal%d:F250_Fit_m:1",ii); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocfcal%d:F250_Fit_s:1",ii); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; } //------------------------------ //---- tab: FCAL ped profile --- //------------------------------ tab=new daqTab(dmf,"FCALm",4,6); tabs.push_back(tab); tabFCALp=tab->ID; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=10; npad=0; for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_pedestals",ii); pad = new daqPad(hist_name,ii,2,1,0," "," "); tab->pads.push_back(pad); pad->TSize=0.1; tab->canvas->cd(ii); gPad->SetGridy(1); gPad->AddExec("f250ped",".x f250ped.C"); } for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_pedmean",ii); tab->canvas->cd(npad); pad = new daqPad(hist_name,npad,1,1,1,"neuo","hist"); tab->pads.push_back(pad); pad->MSize=0.5; pad->TSize=0.1; } //------------------------------ //---- tab: FCAL pulse shape --- //------------------------------ tab=new daqTab(dmf,"FCALs",4,6); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; npad=0; for (int ii=1; ii<=12; ii++) { npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_pulse",ii); pad = new daqPad(hist_name,npad,1,0,1,"e","hist"); tab->pads.push_back(pad); pad->TSize=0.1; npad++; if (npad>tab->max_pads) { printf("Maximum number of pads reached : %d \n",tab->max_pads); break; } sprintf(hist_name,"rocfcal%d:F250_time",ii); pad = new daqPad(hist_name,npad,1,0,1,"euo","hist"); tab->pads.push_back(pad); pad->TSize=0.1; } //-------------------------- //---- tab: STPSC --- //-------------------------- tab=new daqTab(dmf,"STPSC",3,4); tabs.push_back(tab); tabSTPSCr=tab->ID; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=5; pad = new daqPad("rocst:F250_profadc",1,2,1,0," "," "); tab->pads.push_back(pad); tab->canvas->cd(1); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); //--- ped/thr -- npad=2; sprintf(hist_name,"rocst:F250_Fit_s:0"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocst:F250_Fit_m:1"); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocst:F250_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; //---- pad = new daqPad("rocst:F250_Scalers",3,2,1,0," ","colz"); tab->pads.push_back(pad); pad = new daqPad("rocst:F250_pulse",4,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("rocst:F250_time",5,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("rocstpsc2:DISCR_Scalers",6,2,1,0," ","colz"); tab->pads.push_back(pad); // pad = new daqPad("rocstpsc1:F1TDC_occ2D",7,2,1,0," ","colz"); tab->pads.push_back(pad); tab->canvas->cd(5); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); //pad = new daqPad("rocstpsc1:F1TDC_occup",8,1,0,1,"ne","pe"); tab->pads.push_back(pad); //pad = new daqPad("rocstpsc1:F1TDC:03:09",9,1,0,1,"neuo","hist"); tab->pads.push_back(pad); //--- graph LT --- pad=1 sl=4 ch=0 bin=1 !!! pad = new daqPad("ST:DISCR_LU",8,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,3,4,5); tab->canvas->cd(4); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); //------------------------------ //---- tab: TAG + PS etc --- //------------------------------ tab=new daqTab(dmf,"TGPSf",4,3); tabs.push_back(tab); tabTAGr=tab->ID; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; //--- ped --- pad = new daqPad("roctagm1:F250_profadc",1,2,1,0," "," "); tab->pads.push_back(pad); tab->canvas->cd(1); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("roctagh1:F250_profadc",2,2,1,0," "," "); tab->pads.push_back(pad); tab->canvas->cd(2); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocps1:F250_profadc",3,2,1,0," "," "); tab->pads.push_back(pad); tab->canvas->cd(3); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad("rocps2:F250_profadc",4,2,1,0," "," "); tab->pads.push_back(pad); tab->canvas->cd(4); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); //--- ped/thr -- TAGM1 npad=5; sprintf(hist_name,"roctagm1:F250_Fit_s:0"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"roctagm1:F250_Fit_m:1"); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"roctagm1:F250_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; //--- ped/thr -- TAGH1 npad=6; sprintf(hist_name,"roctagh1:F250_Fit_s:0"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"roctagh1:F250_Fit_m:1"); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"roctagh1:F250_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; //--- ped/thr -- PS1 npad=7; sprintf(hist_name,"rocps1:F250_Fit_s:0"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocps1:F250_Fit_m:1"); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocps1:F250_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; //--- ped/thr -- PS2 npad=8; sprintf(hist_name,"rocps2:F250_Fit_s:0"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9hist"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocps2:F250_Fit_m:1"); pad = new daqPad(hist_name,npad,1,0,0," ","p9same"); tab->pads.push_back(pad); pad->MSize=0.5; sprintf(hist_name,"rocps2:F250_Fit_s:1"); tab->canvas->cd(npad); gPad->SetGridy(1); gPad->AddExec("f250",".x f250.C"); pad = new daqPad(hist_name,npad,1,0,0," ","P9same"); tab->pads.push_back(pad); pad->MSize=0.5; pad = new daqPad("roctagm1:F250_Scalers",9,2,1,0," ","colz"); tab->pads.push_back(pad); pad = new daqPad("roctagh1:F250_Scalers",10,2,1,0," ","colz"); tab->pads.push_back(pad); pad = new daqPad("rocps1:F250_Scalers",11,2,1,0," ","colz"); tab->pads.push_back(pad); pad = new daqPad("rocps2:F250_Scalers",12,2,1,0," ","colz"); tab->pads.push_back(pad); //------------------------------ //---- tab: TAG / PS discr. time. --- //------------------------------ tab=new daqTab(dmf,"TGPSt",3,4); tabs.push_back(tab); tabTAGd=tab->ID; printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); tab->update_time=1; pad = new daqPad("roctagm2:DISCR_Scalers",1,2,1,0," ","colz"); tab->pads.push_back(pad); pad = new daqPad("roctagh2:DISCR_Scalers",2,2,1,0," ","colz"); tab->pads.push_back(pad); pad = new daqPad("roctagmh:F1TDC_occ2D",4,2,1,0," ","colz"); tab->pads.push_back(pad); tab->canvas->cd(4); gPad->SetGridy(1); gPad->AddExec("f1tdc",".x f1tdc.C"); //--- graph --- pad=1 sl=5 ch=4 bin=5 !!! pad = new daqPad("H2:DISCR_5:4",5,1,0,0," ","colz"); tab->pads.push_back(pad); gr = pad->timeGraph("dummy",600,2,5,5); tab->canvas->cd(5); gPad->SetGridy(1); if (gr) ALL_GH_HIST->Add(gr); pad = new daqPad("roctagm1:F250_pulse",7,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("roctagm1:F250_time",10,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("roctagh1:F250_pulse",8,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("roctagh1:F250_time",11,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("rocps1:F250_pulse",3,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("rocps1:F250_time",6,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("rocps2:F250_pulse",9,1,0,1,"ne","hist"); tab->pads.push_back(pad); pad = new daqPad("rocps2:F250_time",12,1,0,1,"ne","hist"); tab->pads.push_back(pad); //------------------------------ //---- tab: ERRORS --- //------------------------------ tab=new daqTab(dmf,"ERR",1,1); tabs.push_back(tab); printf("Created TAB id=%d, total=%d \n",tab->ID,dmf->get_n_tabs()); //dmf->fTab->SetEnabled(tab->ID,0); pad = new daqPad("ROC_Errors",1,2,0,1,"i","text"); tab->pads.push_back(pad); //pad->Maximum=10; tab->canvas->cd(1); gPad->SetGridx(1); gPad->SetGridy(1); //------------------------------------------------------------------------ printf("Numb Tabs = %d \n",dmf->get_n_tabs()); printf("Current Tab = %d \n",dmf->fTab->GetCurrent()); printf("Size of tabs = %d \n",tabs.size()); //------------------------------------------------------------------------------- // Book summary hists //------------------------------------------------------------------------------- //---------------------- ERROR hist 2D ---------------------- TRandom *rndm = new TRandom(); const Int_t nx = 9; const Int_t ny = 53; const char *errors[nx] = {"Time mismatch","DMA timeout","tiLive","Error_4","Error_5","Error_6","Error_7","Error_8","Error_9"}; const char *crates[ny] = { "FCAL1", "FCAL2", "FCAL3", "FCAL4", "FCAL5", "FCAL6", "FCAL7", "FCAL8", "FCAL9", "FCAL10", "FCAL11", "FCAL12", "BCAL1","BCAL2","BCAL3","BCAL4","BCAL5","BCAL6","BCAL7","BCAL8","BCAL9","BCAL10","BCAL11","BCAL12", "FDC1","FDC2","FDC3","FDC4","FDC5","FDC6","FDC7","FDC8","FDC9","FDC10","FDC11","FDC12","FDC13","FDC14", "CDC1","CDC2","CDC3","CDC4", "TOF1","TOF2", "STPSC1", "ST", "TAGM1", "TAGH1", "TAGMH", "PS1", "PS2", "TRD1","MUON" }; //c1->SetGrid(); //c1->SetLeftMargin(0.15); //c1->SetBottomMargin(0.15); TH2F *GHerrors = new TH2F("ROC_Errors","ROC_Errors",3,0,3,2,0,2); #if ROOT_VERSION_CODE > ROOT_VERSION(6,0,0) GHerrors->SetCanExtend(TH1::kXaxis); #else GHerrors->SetBit(TH1::kCanRebin); #endif GHerrors->SetStats(0); rndm->SetSeed(); for (Int_t ix=0;ixRndm()*2.); //printf("%d %d rx=%f\n",ix,iy,rx); //GHerrors->Fill(crates[iy],errors[ix],rx); GHerrors->Fill(errors[ix],crates[iy],0.); } } GHerrors->SetMarkerSize(0.8); GHerrors->SetMarkerColor(2); GHerrors->LabelsDeflate("X"); GHerrors->LabelsDeflate("Y"); GHerrors->LabelsOption("d"); GHerrors->GetXaxis()->SetLabelSize(0.03); GHerrors->GetYaxis()->SetLabelSize(0.02); //GHerrors->Draw("text"); ALL_GH_HIST->Add(GHerrors); //---------------------- Time Graph ---------------------- /* const Int_t ngr = 600; const Int_t kNMAX = 10000; Double_t *Xgr = new Double_t[kNMAX]; Double_t *Ygr = new Double_t[kNMAX]; Int_t cursor_gr = 0; TGraph *graph1 = new TGraph(ngr); graph1->SetName("DISCR_Rate"); graph1->SetMarkerStyle(20); graph1->SetMarkerColor(kBlue); graph1->SetMarkerSize(0.5); Double_t xgr = 0; printf("Time now=%f\n",xgr); ALL_GH_HIST->Add(graph1); int np=0; for (Int_t i=0;iGetXaxis()->SetTitle("time, sec"); graph1->GetYaxis()->SetTitle("rate, Hz"); //graph1->GetXaxis()->SetTimeDisplay(1); time_t start_time = time(0); start_time = 3600* (int)(start_time/3600); gStyle->SetTimeOffset(start_time); graph1->GetXaxis()->SetTimeFormat("y. %Y %F2000-01-01 00:00:00"); */ //------------------------------------------------------------------------ //--- Start threads --- //------------------------------------------------------------------------ printf("------------>> Start threads \n"); //---------------- root server ------------------------------------------- int CTAB, s_pad; //TThread *thr_list; TList* thr_list = new TList(); //----- Trigger thread ------ static TThread *thr_hist_trig[20]; SRV_PARAM srv_trig[20]; CTAB=tabTRIGr; s_pad=1; for (int ii=1; ii<=3; ii++) { sprintf(srv_trig[ii].REM_HOST,"roctrig%d",ii); srv_trig[ii].tab=CTAB; srv_trig[ii].canvas=tabs[CTAB]->canvas; srv_trig[ii].pad=s_pad; srv_trig[ii].RunInfo=NULL; sprintf(srv_trig[ii].thread_name,"hist_trig%d_thread",ii); thr_hist_trig[ii] = new TThread(srv_trig[ii].thread_name, hist_client2,(void*) &srv_trig[ii]); thr_hist_trig[ii]->Run(); thr_list->Add(thr_hist_trig[ii]); } //----- TOF thread ------ static TThread *thr_hist_tof[20]; SRV_PARAM srv_tof[20]; CTAB=tabTOFr; s_pad=1; for (int ii=1; ii<=3; ii++) { sprintf(srv_tof[ii].REM_HOST,"roctof%d",ii); srv_tof[ii].tab=CTAB; srv_tof[ii].canvas=tabs[CTAB]->canvas; srv_tof[ii].pad=s_pad; srv_tof[ii].RunInfo=NULL; sprintf(srv_tof[ii].thread_name,"hist_tof%d_thread",ii); thr_hist_tof[ii] = new TThread(srv_tof[ii].thread_name, hist_client2,(void*) &srv_tof[ii]); thr_hist_tof[ii]->Run(); thr_list->Add(thr_hist_tof[ii]); } //----- BCAL thread ------ static TThread *thr_hist_bcal[20]; SRV_PARAM srv_bcal[20]; CTAB=tabBCALr; s_pad=1; //int bcal_fadc[] = {1,2,4,5,7,8,10,11}; for (int ii=1; ii<=16; ii++) { //int ii=bcal_fadc[i]; sprintf(srv_bcal[ii].REM_HOST,"rocbcal%d",ii); srv_bcal[ii].tab=CTAB; srv_bcal[ii].canvas=tabs[CTAB]->canvas; srv_bcal[ii].pad=s_pad++; srv_bcal[ii].RunInfo=NULL; sprintf(srv_bcal[ii].thread_name,"hist_bcal%d_thread",ii); thr_hist_bcal[ii] = new TThread(srv_bcal[ii].thread_name, hist_client2,(void*) &srv_bcal[ii]); thr_hist_bcal[ii]->Run(); thr_list->Add(thr_hist_bcal[ii]); } //----- FCAL thread ------ static TThread *thr_hist_fcal[20]; SRV_PARAM srv_fcal[20]; CTAB=tabFCALr; s_pad=1; for (int ii=1; ii<=12; ii++) { sprintf(srv_fcal[ii].REM_HOST,"rocfcal%d",ii); srv_fcal[ii].tab=CTAB; srv_fcal[ii].canvas=tabs[CTAB]->canvas; srv_fcal[ii].pad=s_pad++; srv_fcal[ii].RunInfo=NULL; sprintf(srv_fcal[ii].thread_name,"hist_fcal%d_thread",ii); thr_hist_fcal[ii] = new TThread(srv_fcal[ii].thread_name, hist_client2,(void*) &srv_fcal[ii]); thr_hist_fcal[ii]->Run(); thr_list->Add(thr_hist_fcal[ii]); } //----- STPSC thread ------ static TThread *thr_hist_stpsc[20]; SRV_PARAM srv_stpsc[20]; CTAB=tabSTPSCr; s_pad=1; for (int ii=0; ii<=2; ii++) { if (ii==0) sprintf(srv_stpsc[ii].REM_HOST,"rocst"); else sprintf(srv_stpsc[ii].REM_HOST,"rocstpsc%d",ii); srv_stpsc[ii].tab=CTAB; srv_stpsc[ii].canvas=tabs[CTAB]->canvas; srv_stpsc[ii].pad=s_pad++; srv_stpsc[ii].RunInfo=NULL; sprintf(srv_stpsc[ii].thread_name,"hist_stpsc%d_thread",ii); thr_hist_stpsc[ii] = new TThread(srv_stpsc[ii].thread_name, hist_client2,(void*) &srv_stpsc[ii]); thr_hist_stpsc[ii]->Run(); thr_list->Add(thr_hist_stpsc[ii]); } //----- TAG M thread ------ static TThread *thr_hist_tag[20]; SRV_PARAM srv_tag[20]; char * tag_host[] = {"roctagm1", "roctagh1", "roctagm2", "roctagh2", "roctagmh", "rocps1", "rocps2", "iocpulser1", "iocpulser2" , "ioctagctrl","roctrd1","rocfmwpc1","rocccal","rocdirc" }; CTAB=tabTAGr; s_pad=1; for (int ii=0; ii<=13; ii++) { sprintf(srv_tag[ii].REM_HOST,"%s",tag_host[ii]); srv_tag[ii].tab=CTAB; srv_tag[ii].canvas=tabs[CTAB]->canvas; srv_tag[ii].pad=s_pad++; srv_tag[ii].RunInfo=NULL; sprintf(srv_tag[ii].thread_name,"hist_%s_thread",tag_host[ii]); thr_hist_tag[ii] = new TThread(srv_tag[ii].thread_name, hist_client2,(void*) &srv_tag[ii]); thr_hist_tag[ii]->Run(); thr_list->Add(thr_hist_tag[ii]); } //----- CDC thread ------ static TThread *thr_hist_cdc[20]; SRV_PARAM srv_cdc[20]; CTAB=1; s_pad=1; for (int ii=1; ii<=4; ii++) { sprintf(srv_cdc[ii].REM_HOST,"roccdc%d",ii); srv_cdc[ii].tab=CTAB; srv_cdc[ii].canvas=tabs[CTAB]->canvas; srv_cdc[ii].pad=s_pad++; srv_cdc[ii].RunInfo=NULL; sprintf(srv_cdc[ii].thread_name,"hist_cdc%d_thread",ii); thr_hist_cdc[ii] = new TThread(srv_cdc[ii].thread_name, hist_client2,(void*) &srv_cdc[ii]); thr_hist_cdc[ii]->Run(); thr_list->Add(thr_hist_cdc[ii]); } //----- FDC thread ------ static TThread *thr_hist_fdc[20]; SRV_PARAM srv_fdc[20]; CTAB=1; s_pad=1; for (int ii=1; ii<=14; ii++) { sprintf(srv_fdc[ii].REM_HOST,"rocfdc%d",ii); srv_fdc[ii].tab=CTAB; srv_fdc[ii].canvas=tabs[CTAB]->canvas; srv_fdc[ii].pad=s_pad++; srv_fdc[ii].RunInfo=NULL; sprintf(srv_fdc[ii].thread_name,"hist_fdc%d_thread",ii); thr_hist_fdc[ii] = new TThread(srv_fdc[ii].thread_name, hist_client2,(void*) &srv_fdc[ii]); thr_hist_fdc[ii]->Run(); thr_list->Add(thr_hist_fdc[ii]); } //thr_list->Print(); TThread::Ps(); printf("------------> all THREADS are STARTED <------------------\n"); sleep(3); gStyle->SetOptFit(11111); //------------------------------------------------------------------------------- // Mainf Loop //------------------------------------------------------------------------------- while(1) { int ID=dmf->CurrentTAB; CurrentTAB=dmf->CurrentTAB; printf("update_Tab:: current tab =%d hRunInfo=%p \n",ID,hRunInfo); char Lname[64]; int RunNo=-1; int Nevents=-1; TThread::Lock(); if (!strncmp(getenv("USER"),"hdtrdops",8)) { hRunInfo=srv_tag[10].RunInfo; //--- get from roctrd1 , TRD } else { hRunInfo=srv_trig[1].RunInfo; //--- get from roctrig1 , TSG --- } if (hRunInfo) { printf("hRunInfo=%p\n",hRunInfo); RunNo=hRunInfo->GetBinContent(1); Nevents=hRunInfo->GetBinContent(2); } TThread::UnLock(); sprintf(Lname, "Run: %d",RunNo); dmf->Lrunnum->ChangeText(Lname); sprintf(Lname, "Ev: %d",Nevents); dmf->Levtnum->ChangeText(Lname); //------------------------------------------------------------------------------------------------------- // TI Busy //------------------------------------------------------------------------------------------------------- char CBIN[20]; int tibusy; int ixbin=0; for (int ix=0; ixGetBinContent(3); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } for (int ii=1; ii<=16; ii++) { //-- BCAL -- if (srv_bcal[ii].RunInfo==NULL) continue; sprintf(CBIN,"BCAL%d",ii); int bf=0; for (int iy=0; iyGetBinContent(3); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } for (int ii=1; ii<=12; ii++) { //-- FCAL -- if (srv_fcal[ii].RunInfo==NULL) continue; sprintf(CBIN,"FCAL%d",ii); int bf=0; for (int iy=0; iyGetBinContent(3); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } for (int ii=1; ii<=14; ii++) { //-- FDC -- if (srv_fdc[ii].RunInfo==NULL) continue; sprintf(CBIN,"FDC%d",ii); int bf=0; for (int iy=0; iyGetBinContent(3); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } for (int ii=1; ii<=4; ii++) { //-- CDC -- if (srv_cdc[ii].RunInfo==NULL) continue; sprintf(CBIN,"CDC%d",ii); int bf=0; for (int iy=0; iyGetBinContent(3); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } for (int ii=1; ii<=3; ii++) { //-- TOF -- if (srv_tof[ii].RunInfo==NULL) continue; sprintf(CBIN,"TOF%d",ii); int bf=0; for (int iy=0; iyGetBinContent(3); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } for (int ii=0; ii<3; ii++) { //-- STPSC -- if (srv_stpsc[ii].RunInfo==NULL) continue; if (ii==0) sprintf(CBIN,"%s","ST"); else sprintf(CBIN,"STPSC%d",ii); int bf=0; for (int iy=0; iyGetBinContent(3); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } char * htag_host[] = {"TAGM1", "TAGH1", "TAGM2", "TAGH2", "TAGMH", "PS1", "PS2","TRD1","MUON"}; for (int ii=0; ii<=8; ii++) { //-- TAG -- if (srv_tag[ii].RunInfo==NULL) continue; sprintf(CBIN,"%s",htag_host[ii]); int bf=0; for (int iy=0; iyGetBinContent(3); //printf("%s %d \n",CBIN,bf); if (bf>0) GHerrors->SetBinContent(ixbin,bf,tibusy); } TThread::UnLock(); //------------------------------------------------------------------------------------------------------- // Draw Local hists //------------------------------------------------------------------------------------------------------- int id,nf=0; TObject *obj; TIter next0(ALL_GH_HIST); while ((obj = next0())) { TH1 *hist = (TH1 *) obj; TGraph *graph = (TGraph *) obj; daqPad* Gpad_src=NULL; TH2* Gh2_src=NULL; //printf("Local Hist search:: nf=%d name=o:%s: h:%s:\n", nf, obj->GetName(), hist->GetName()); //printf("Local Hist search:: nf=%d name=o:%s: \n", nf, obj->GetName()); //obj->Print(); double padscale=sqrt((double)tabs[CurrentTAB]->pads.size()); gStyle->SetTitleSize(0.03+0.01*padscale,"t"); //-- TITLE size as "fraction of the pad" --- gStyle->SetStatW(0.1+0.05*padscale); // gStyle->SetStatX(0.4); gStyle->SetStatH(0.05+0.025*padscale); gStyle->SetStatY(0.9); //gStyle->SetStatH(-1.); gStyle->SetStatY(0.9); daqPad* pad = pad_find(hist->GetName(),tabs[CurrentTAB]); if (pad) { TThread::Lock(); tabs[CurrentTAB]->canvas->cd(pad->Pad); if (pad->GraphSize==0) { //---- 1D hist -no statistic ---- printf("1D hist name=:%s: stat=%d\n", hist->GetName(),pad->Stat); hist->SetStats(pad->Stat); } else if (pad->GraphSize>0) { //----- Time Graph ------------- Gpad_src = pad_find_id(pad->GraphSrc,tabs[CurrentTAB]); // pad_find("roctof3:DISCR_Scalers",tabs[CurrentTAB]); if (!Gpad_src) { printf("Graph:: src pad not found \n"); } else { Gh2_src=Gpad_src->hist2; if (!Gh2_src) { printf("Graph:: src hist not found \n"); } else { printf("Graph:: TRY: src=%d, bin=(%d,%d), ptr=%p .... ",pad->GraphSrc,pad->GraphXbin, pad->GraphYbin, Gh2_src); double c; if (Gh2_src) c = Gh2_src->GetBinContent(pad->GraphXbin,pad->GraphYbin); //printf(" cont=%f \n",pad->GraphSrc,pad->GraphXbin, pad->GraphYbin, c, Gh2_src); if (pad->GraphSrc==0) { printf("Graph:: fill src=%d \n",pad->GraphSrc); //------------------------------------------------------------------------------------- /* if (cursor_gr > kNMAX-ngr-1) { for (Int_t i=0;iGetBinContent(pad->GraphXbin,pad->GraphYbin); cursor_gr++; */ //------------------------------------------------------------------------------------- } else { unsigned long tm=time(NULL); //printf("Graph:: fill src=%d time=%lu, %f\n",pad->GraphSrc,tm,(double)tm); if (Gh2_src) pad->fillGraph2((double)tm,Gh2_src->GetBinContent(pad->GraphXbin,pad->GraphYbin)); } } //TThread::UnLock(); } } //gGlobalMutex->Lock(); //TThread::Lock(); //gStyle->SetOptStat(pad->Hopt); //if (pad->RightMargin>0) gStyle->SetPadRightMargin(pad->RightMargin); // increase for colz plots!! if (pad->Maximum>0) hist->SetMaximum(pad->Maximum); //h->GetZaxis()->SetLabelOffset(0.01); if (pad->LogY>0) gPad->SetLogy(); //printf("hist name=:%s: stat=%d draw opt=%s\n", hist->GetName(),pad->Stat,pad->Dopt); if (pad->GraphSize>0 && Gh2_src) { //------ Time Graph ---- gPad->Clear(); if (pad->GraphSrc>0) { //printf("Graph:: fill src=%d addr=%p,%p \n",pad->GraphSrc, graph,pad->graph); graph=pad->graph; } graph->GetXaxis()->SetTitle("time, sec"); graph->GetYaxis()->SetTitle("rate, Hz"); graph->GetXaxis()->SetTitleSize(0.06); graph->GetYaxis()->SetTitleSize(0.06); graph->GetXaxis()->SetLabelSize(0.06); graph->GetYaxis()->SetLabelSize(0.06); graph->GetXaxis()->SetTitleOffset(0.8f); graph->GetYaxis()->SetTitleOffset(0.9f); //if (pad->GraphSrc>0) //graph->DrawGraph(pad->GraphSize,&pad->GraphX[0],&pad->GraphY[0],"alp"); graph->Draw("alp"); //else //graph->DrawGraph(ngr,&Xgr[cursor_gr],&Ygr[cursor_gr],"alp"); graph->GetXaxis()->SetTimeDisplay(1); //graph->GetXaxis()->SetTimeFormat("y. %Y %F2000-01-01 00:00:00"); gPad->Update(); } else { //------ 1D histogram ------- hist->Draw(pad->Dopt); } //gGlobalMutex->UnLock(); TThread::UnLock(); //gPad->Update(); tabs[CurrentTAB]->modified++; } } //------------------------------------------------------------------------------------------------------- // //------------------------------------------------------------------------------------------------------- //printf("+"); fflush(stdout); TThread::Lock(); tabs[ID]->modified=0; tabs[ID]->canvas->Modified(); tabs[ID]->canvas->Update(); TThread::UnLock(); //putchar(':'); fflush(stdout); printf("--------------------------> main:: plot done , update canvas done, usleep/process \n"); //----- sleep ----- int TIME=1*1000000; //-- sec -- gettimeofday(&tvA[0], NULL); time_t t1=time(NULL); while (1) { gettimeofday(&tvB[0], NULL); int idiff=tvB[0].tv_usec - tvA[0].tv_usec + 1000000 * (tvB[0].tv_sec - tvA[0].tv_sec); //if (idiff>TIME && HIST_UPDATED!=1) break; time_t t2=time(NULL); button_PAUSE=dmf->v_PAUSE; if ( (idiff>TIME || (dmf->CurrentTAB != ID) || (tabs[dmf->CurrentTAB]->modified>3) ) && button_PAUSE==0 ) { //printf("break: timer=%d n_mod_tab=%d\n",idiff, tabs[dmf->CurrentTAB]->modified); break; } //putchar('?'); fflush(stdout); //gGlobalMutex->Lock(); TThread::Lock(); gSystem->ProcessEvents(); //putchar('.'); fflush(stdout); //gGlobalMutex->UnLock(); TThread::UnLock(); //putchar('!'); fflush(stdout); if (dmf->v_SAVE) { button_SAVE=1; printf("--------> SAVE <--------------\n"); //char pngname[256]; //sprintf(pngname,"Run%06d_%s.png",RunNo,tabs[ID]->name); //tabs[ID]->canvas->Print(pngname); tabs[ID]->Print(RunNo); button_SAVE=0; dmf->v_SAVE=0; } if (dmf->v_EXIT) { button_EXIT=1; break; } usleep(100); } if (button_EXIT) break; } //-------------------------------------------------------------------------------------------------- // E X I T //-------------------------------------------------------------------------------------------------- printf("Button EXIT=%d\n",button_EXIT); // Hand control to the ROOT "event" loop //theApp.SetReturnFromRun(true); //theApp.Run(); TThread::SetCancelAsynchronous(); TThread::SetCancelOn(); TObject *obj; TIter next2(thr_list); while ((obj = next2())) { printf("kill next thread: \n"); TThread *th = (TThread *) obj; th->Print(); th->Kill(); printf("done \n"); } printf("All done \n"); /* TIter next3(thr_list); while ((obj = next3())) { printf("Join next thread: \n"); TThread *th = (TThread *) obj; th->Print(); th->Join(); printf("Join done \n"); } printf("All Join done \n"); */ //delete dmf; dmf->Cleanup(); printf("dmf deleted \n"); return 0; //exit(0); }