00001 // Version PWP 26.11.02 add st_set_idle() and st_kill_idle() 00002 // remove st_idle() 00003 // Transfer to SCTAPI 00004 00005 void buttons() { // Needs to be same name as file for auto-start 00006 int ret; 00007 00008 api_menu(); 00009 00010 printf(" ...ready for action!\n"); 00011 } 00012 00013 00014 void api_menu(){ 00015 00016 TControlBar* bar = new TControlBar("vertical","SCT_API",0,0); 00017 bar->SetNumberOfColumns(2); 00018 00019 // bar->AddButton("Startup","e->Startup();st_display_dcs()","RELOAD DEFAULT SYSTEM AND MODULE PARAMETERS"); 00020 // bar->AddButton("Shutdown","e->Shutdown();st_display_dcs()","OPTO TX off, SCTLV off"); 00021 bar->AddButton("Restart","api_restart()","Reload parameters and restart system"); 00022 00023 // Leave "Run" and "Stop" here because they're jolly useful - PWP 07.08.00 00024 bar->AddButton("Run Triggers","api_free()","Free Running Triggers"); 00025 bar->AddButton("Stop Trigger","api_stopTrigs()","Stop Running Triggers"); 00026 00027 // Simple interactive configs and bursts 00028 // bar->AddButton("ChangeVariable","st_menu_change_variable()","Present the SetVariable panel"); 00029 bar->AddButton("ABCD Tests","api_menu_macros()","Brief tests"); 00030 00031 // Change / Show configurations 00032 bar->AddButton("Show status","tapi.status()","Display current system configuration"); 00033 // bar->AddButton("ShowModuleConfig","st_dialog_show_module_config()","Display current settings for a given module"); 00034 00035 bar->AddButton("OPTO TX off", "tapi.lasersOff()", "Turn off VcSELs"); 00036 bar->AddButton("BOC Status","api_boc_status()","Show status of BOC"); 00037 00038 bar->AddButton("Probe ROD", "api_probe()", "Show status of Modules attached to ROD"); 00039 00040 // bar->AddButton("DCSQuery","st_dcs_query()", "Query DCS for given module"); 00041 00042 // bar->AddButton("TestPrograms","st_menu_test_programs()","Diagnostic programs"); 00043 // bar->AddButton("Status","e->PrintStatus()","System Status"); 00044 // bar->AddButton("Documentation","st_docs()","Browse Documentation"); 00045 bar->AddButton("Exit","api_exit()","Power off and Exit ROOT"); 00046 bar->Show(); 00047 00048 // gROOT->SaveContext(); 00049 } 00050 00051 void api_exit(){ 00052 char c1; 00053 00054 printf("\nDo you really want to exit the CINT/ROOT/SCTAPI environment? (y/n)\n"); 00055 scanf("%c",&c1); 00056 if(c1!='y') return; 00057 00058 tapi.shutdownAll(); 00059 00060 // The following method of exiting ST does so abruptly, without 00061 // the tedious infinite loop of error messages produced by .q 00062 gSystem->Exit(0,0); 00063 } 00064 00065 void api_restart() { 00066 int runNumber = 0; 00067 printf("\nWhat run number do you want to restart with?\n"); 00068 scanf("%d",&runNumber); 00069 00070 tapi.initialiseAll(runNumber); 00071 } 00072 00073 // void st_set_idle(){ 00074 // printf("Starting DCS monitor\n"); 00075 // gROOT->Idle(10, "st_display_dcs();"); 00076 00077 // // Run it once to start off with 00078 // st_display_dcs(); 00079 // } 00080 00081 // void st_kill_idle(){ 00082 // printf("Stopping DCS monitor\n"); 00083 // gROOT->Idle(0, "st_display_dcs();"); 00084 // } 00085 00086 00087 // Keep these for later 00088 00089 void st_menu_analogue_scans(){ 00090 00091 TControlBar* abar = new TControlBar("vertical","ST scans"); 00092 abar->SetNumberOfColumns(2); 00093 00094 // Simple 1D scans using tburst. Chips in data taking mode. 00095 // nb: scan loop must be in macro to permit dynamic histogram display updates 00096 abar->AddButton("Scan", "st_scan(1,-1)","Repeat Last Scan"); 00097 abar->AddButton("ScanElapsed", "st_scan(1, 0)","Repeat Trigger Burst under the same conditions"); 00098 abar->AddButton("ScanThreshold", "st_scan(1, 1)","Scan Threshold in mV"); 00099 abar->AddButton("ScanVCal", "st_scan(1, 2)","Scan Calibration level in mV"); 00100 //abar->AddButton("ScanQThreshold", "st_scan(1,41)","Scan Threshold in fC"); 00101 abar->AddButton("ScanQCal", "st_scan(1,42)","Scan Calibration level in fC"); 00102 abar->AddButton("ScanStrobeDelay","st_scan(1, 3)","Scan On Chip Strobe Delay"); 00103 abar->AddButton("ScanPreamp", "st_scan(1, 4)","Scan Preamplifier Bias current in microA"); 00104 abar->AddButton("ScanShaper", "st_scan(1, 5)","Scan Shaper current in microA"); 00105 abar->AddButton("ScanStreamDelay","st_scan(1,20)","Relative phase of CLK and DATA at MuSTARD"); 00106 abar->AddButton("ScanClockDuty", "st_scan(1,23)","Scan Clock Duty Cycle (NOT RECOMMENDED)"); 00107 abar->AddButton("ScanComDelay", "st_scan(1,25)","n BCOs between Reset and Command (SLOG only)"); 00108 abar->AddButton("ScanPulseDelay", "st_scan(1,26)","n BCOs between Pulse Input and L1A"); 00109 abar->AddButton("ScanTrigDelay", "st_scan(1,27)","n BCOs between Cal Strobe and L1A "); 00110 abar->AddButton("ScanVcc", "st_scan(1,31)",""); 00111 abar->AddButton("ScanVdd", "st_scan(1,33)",""); 00112 abar->AddButton("ScanVLED", "st_scan(1,35)",""); 00113 00114 if(e->nOPTIFs>0){ 00115 abar->AddButton("ScanOPTO RX THR","st_scan(1,50)",""); 00116 abar->AddButton("ScanOPTO TX DAC","st_scan(1,53)",""); 00117 } 00118 00119 abar->AddButton("ShowScan", "e->ShowScan()",""); 00120 abar->AddButton("ScanMenu", "e->ScanMenu()",""); 00121 00122 abar->Show(); 00123 } 00124 00125 // And these 00126 00127 void st_menu_digital_scans(){ 00128 00129 TControlBar *dbar = new TControlBar("vertical","ST"); 00130 00131 // Simple 1D scans using rawburst. Chips in send ID mode, 00132 // configs executed before each trigger. Returned data is 00133 // compared against the expected result and errors totalled. 00134 dbar->AddButton("Scan", "st_scan(6,-1)","Repeat Last Scan"); 00135 dbar->AddButton("ScanStreamDelay","st_scan(6,20)",""); 00136 dbar->AddButton("ScanClockDuty", "st_scan(6,23)",""); 00137 dbar->AddButton("ScanVdd", "st_scan(6,33)",""); 00138 dbar->AddButton("ScanVLED", "st_scan(6,35)",""); 00139 // dbar->AddButton("ShowScan", "e->ShowScan()",""); 00140 // dbar->AddButton("ScanMenu", "e->ScanMenu()",""); 00141 00142 dbar->Show(); 00143 } 00144 00145 void api_menu_macros(){ 00146 00147 TControlBar* mbar = new TControlBar("vertical","SCTAPI Macros"); 00148 00149 // if(e->nSCTHV>0){ 00150 // mbar->AddButton("IV Curve", "st_iv()","Record the IV characteristic"); 00151 // } 00152 // mbar->AddButton("Set Stream Delay", "st_tm()","Automatic Adjustment of Stream Delay"); 00153 // mbar->AddButton("Hard Reset Tests", "st_hr()","Verify Hard Reset Functionality"); 00154 // mbar->AddButton("Full Bypass Test", "st_fbt()","Verify Bypass Functionality"); 00155 // mbar->AddButton("Redundancy Test", "st_rt()","Check Redundant Clock and Command"); 00156 // mbar->AddButton("Pipeline Test", "st_pt()","Find dead cells in the pipeline"); 00157 mbar->AddButton("Do strobe Delay", "api_sd()","Automatic Adjustment of Strobe Delay"); 00158 mbar->AddButton("Three Point Gain", "api_tpg()","Fast measurement of gain and noise"); 00159 // mbar->AddButton("Trim Range", "st_tr()","Trimming, all four ranges"); 00160 // mbar->AddButton("Trim Scan", "st_ts()","Automatic Trimming"); 00161 mbar->AddButton("Response Curve", "api_rc()",""); 00162 mbar->AddButton("NMask scan", "api_nmask()",""); 00163 // mbar->AddButton("Noise Occupancy", "st_no()",""); 00164 // mbar->AddButton("Timewalk", "st_tw()",""); 00165 00166 // mbar->AddButton("Characterisation Sequence", "st_characterisation()","Full Test Sequence"); 00167 // mbar->AddButton("Confirmation Sequence", "st_confirmation()","Short Test Sequence"); 00168 00169 // mbar->AddButton("Endcap Hybrid LTT","st_eltt()","LTT (cold & warm) of Endcap Hybrids"); 00170 // mbar->AddButton("Hybrid Warm LTT", "st_hltt()","Warm Long Term Test of Barrel Hybrids"); 00171 // mbar->AddButton("Hybrid Cold LTT", "st_cltt()","Cold Long Term Test of Barrel Hybrids"); 00172 // mbar->AddButton("Module LTT", "st_mltt()","Long Term Test of Modules"); 00173 // mbar->AddButton("IV LTT", "st_ivltt()","Long Term Test of Detector Leakage Current"); 00174 00175 mbar->Show(); 00176 } 00177 00178 void st_menu_change_trigger(){ 00179 00180 TControlBar* trbar = new TControlBar("vertical","ST trigger"); 00181 trbar->SetNumberOfColumns(1); 00182 00183 trbar->AddButton("Set ntrigs", "st_dialog_set_ntrigs()", "No. Triggers per burst"); 00184 trbar->AddButton("L1A", "st_menu_set_trigger(0)", "0 - using CLOAC"); 00185 trbar->AddButton("CAL+L1A", "st_menu_set_trigger(3)", "3 - using CLOAC"); 00186 trbar->AddButton("PULSE+L1A", "st_menu_set_trigger(20)","20 - using CLOAC"); 00187 trbar->AddButton("Pretrigger+L1A","st_menu_set_trigger(30)","30 - PT, COM_DELAY, L1A"); 00188 trbar->AddButton("BCR+L1A", "st_menu_set_trigger(32)","32 - PT/BCR, COM_DELAY, L1A"); 00189 trbar->AddButton("BCR+CAL+L1A", "st_menu_set_trigger(34)","34 - PT/BCR, COM_DELAY, CAL, TRIG_DELAY, L1A"); 00190 trbar->AddButton("BCR+PULSE+L1A", "st_menu_set_trigger(36)","36 - PT/BCR, COM_DELAY, CAL, PULSE_DELAY, L1A"); 00191 trbar->AddButton("SR+L1A", "st_menu_set_trigger(31)","31 - PT/SR, COM_DELAY, L1A"); 00192 trbar->AddButton("SR+CAL+L1A", "st_menu_set_trigger(33)","33 - PT/SR, COM_DELAY, CAL, TRIG_DELAY, L1A"); 00193 trbar->AddButton("SR+PULSE+L1A", "st_menu_set_trigger(35)","35 - PT/SR, COM_DELAY, CAL, PULSE_DELAY, L1A"); 00194 00195 trbar->AddButton("USER", "st_menu_set_trigger(39)","39 - User sequence: file 'sctvar/config/slog.txt'"); 00196 00197 trbar->AddButton("8*L1A", "st_menu_set_trigger(40)","40 - 8 Consecutive L1A"); 00198 trbar->AddButton("SR+(8*L1A)", "st_menu_set_trigger(41)","41 - SR, 8 Consecutive L1A"); 00199 trbar->AddButton("SR+CAL+(8*L1A)","st_menu_set_trigger(43)","43 - SR, CAL,8 Consecutive L1A"); 00200 trbar->AddButton("SR+PULSE+(8*L1A)", "st_menu_set_trigger(45)","45 - SR, PULSE,8 Consecutive L1A"); 00201 00202 trbar->AddButton("SR+(n*L1A)", "st_menu_set_trigger(52)","52 - SR, n spaced L1A"); 00203 trbar->AddButton("SR+CAL+(n*L1A)","st_menu_set_trigger(51)","51 - SR, CAL, n spaced L1A"); 00204 trbar->AddButton("SR+PULSE+(n*L1A)", "st_menu_set_trigger(50)","50 - SR, PULSE,n spaced L1A"); 00205 00206 trbar->AddButton("do_cal_loop", "st_menu_do_cal_loop(1)", "Loop over four cal lines"); 00207 trbar->AddButton("skip_cal_loop", "st_menu_do_cal_loop(0)", "Single cal line only"); 00208 trbar->Show(); 00209 } 00210 00211 void st_scan(short burst_type, short scan_type){ 00212 TScanDef scan; 00213 00214 // The Basic Scan Routine!! 00215 // Revised PWP 09.05.01 to allow: 00216 // Adjustment of burst_ntrigs during NO scans 00217 // Autostop 00218 00219 int stop_loop = 0; 00220 int n_to_continue=0; 00221 short n, fitf; 00222 00223 // st_start_stopper(); // start stop dialog 00224 scan.scanVariable = scan_type; 00225 00226 stop_loop = 0; 00227 00228 tapi.doScan(scan); 00229 } 00230 00231 void api_free() { 00232 tapi.freeTriggers(getPartition(), getCrate(), 100); 00233 } 00234 00235 void api_stopTrigs() { 00236 tapi.stopTriggers(getPartition(), getCrate()); 00237 } 00238 00239 void api_boc_status() { 00240 tapi.printBOCSetup(getPartition(), getCrate(), getRodNumber()); 00241 } 00242 00243 void api_probe() { 00244 tapi.probe(getPartition(), getCrate(), getRodNumber()); 00245 } 00246 00247 // void st_display_dcs() { 00248 00249 // char s[128],t[128]; 00250 // int col = 17; 00251 // int n, npan, ipan, nmodppan; 00252 00253 // TCanvas *pburst[4]; 00254 // TPad *pburst_text[4]; 00255 00256 // nmodppan = e->num_panelmods; 00257 // npan = (e->num_showmods-1)/nmodppan+1; 00258 // if(npan > 4) npan = 4; 00259 00260 // e->DCSQuery(); // update information for all present modules 00261 // // not just for e->num_showmods PWP 11.02.03 00262 00263 // for(ipan=0;ipan<npan;ipan++){ 00264 // sprintf(t,"pburst%d",ipan); 00265 // pburst[ipan] = (TCanvas*) gROOT->FindObject(t); 00266 // if(pburst[ipan]==0){ 00267 // st_styles(); 00268 // if(npan == 1) 00269 // sprintf(s,"Burst Display Run %d", e->runnum); 00270 // else 00271 // sprintf(s,"Burst Display Run %d Modules %d-%d", e->runnum,ipan*nmodppan,(ipan+1)*nmodppan-1); 00272 // pburst[ipan] = new TCanvas(t,s,1100,750); 00273 // pburst[ipan]->SetFillColor(18); 00274 // } 00275 // pburst[ipan]->cd(); 00276 00277 // sprintf(t,"pburst_text%d",ipan); 00278 // pburst_text[ipan] = (TPad*) gROOT->FindObject(t); 00279 // if(pburst_text[ipan]==0){ 00280 // pburst[ipan]->cd(); 00281 // pburst_text[ipan] = new TPad(t,"Burst Text Pad", 0.9,0.0,1.0,0.88,col); 00282 // pburst_text[ipan]->Draw(); 00283 // pburst_text[ipan]->cd(); 00284 // pburst_text[ipan]->Divide(1,nmodppan,0,0); 00285 // } 00286 00287 // for (n=ipan*nmodppan; n<e->num_showmods && n<(ipan+1)*nmodppan; n++){ 00288 // pburst_text[ipan]->cd(n-ipan*nmodppan+1); 00289 // gPad->Clear(); 00290 // e->m[n]->GetDCSBurstText()->Draw(); 00291 // } 00292 // pburst[ipan]->Modified(); 00293 // pburst[ipan]->Update(); 00294 // } 00295 // } 00296 00297 // void st_save_scan(TFile* out=0, Int_t accbst=0) { 00298 00299 // int n; 00300 // char fname[128]; 00301 // char mname[32]; 00302 // Float_t tmp[6]; 00303 // TGraph* gr; 00304 // TH1F* haccbst=0; 00305 00306 // int write_fits=0; 00307 00308 // // this function should be viewed as purely temporary... famous last words ! 00309 00310 // sprintf(fname,"%sstrun%d_%d.root",DATA_DIRECTORY,e->runnum,e->scannum); 00311 // if(out==0) out = new TFile(fname,"RECREATE"); 00312 00313 // TDatime *dt = new TDatime; 00314 // TObjString *dts = new TObjString(dt->AsString()); 00315 // TObjString *pls = new TObjString(LOCATION_NAME); 00316 // TObjString *host= new TObjString(gSystem->Getenv("COMPUTERNAME")); 00317 // TObjString *user= new TObjString(gSystem->Getenv("SCTDB_USER")); 00318 00319 // dts->Write("Time"); 00320 // pls->Write("Place"); 00321 // host->Write("Host"); 00322 // user->Write("User"); 00323 00324 // for (n=0; n<e->GetMaxModules(); n++){ 00325 // if(e->m[n]->scan_fitted){ 00326 // write_fits++; 00327 // } 00328 // } 00329 00330 // // write environmental info to file 00331 // if(st_get_dcsrem(tmp)){ 00332 // sprintf(fname,"%3.1f",tmp[0]); 00333 // TObjString * et1s = new TObjString(fname); 00334 // et1s->Write("ET1"); 00335 // delete et1s; 00336 00337 // sprintf(fname,"%3.1f",tmp[1]); 00338 // TObjString * et2s = new TObjString(fname); 00339 // et2s->Write("ET2"); 00340 // delete et2s; 00341 00342 // sprintf(fname,"%3.1f",tmp[2]); 00343 // TObjString * et3s = new TObjString(fname); 00344 // et3s->Write("ET3"); 00345 // delete et3s; 00346 00347 // sprintf(fname,"%3.1f",tmp[3]); 00348 // TObjString * hums = new TObjString(fname); 00349 // hums->Write("HUM"); 00350 // delete hums; 00351 00352 // sprintf(fname,"%3.1f",tmp[4]); 00353 // TObjString * pips = new TObjString(fname); 00354 // pips->Write("PIPE"); 00355 // delete pips; 00356 // } 00357 00358 // for (n=0; n<e->GetMaxModules(); n++){ 00359 // // if(e->m[n]->present){ // only write histograms for present modules 00360 00361 // e->GetModuleName(n,mname); 00362 // TObjString * mns = new TObjString(mname); 00363 // mns->Write("ModuleName"); 00364 // delete mns; 00365 00366 // e->GetDeviceType(n,fname); 00367 // TObjString * dut = new TObjString(fname); 00368 // dut->Write("DUT"); 00369 // delete dut; 00370 00371 // // sprintf formats in this section revised PWP 28.03.02 00372 // sprintf(fname,"%2.1f",e->m[n]->DCS->T1); 00373 // TObjString * t1s = new TObjString(fname); 00374 // t1s->Write("T0"); 00375 // delete t1s; 00376 00377 // sprintf(fname,"%2.1f",e->m[n]->DCS->T2); 00378 // TObjString * t2s = new TObjString(fname); 00379 // t2s->Write("T1"); 00380 // delete t2s; 00381 00382 // sprintf(fname,"%3.1f",e->m[n]->DCS->vdet); 00383 // TObjString * vdets = new TObjString(fname); 00384 // vdets->Write("VDET"); 00385 // delete vdets; 00386 00387 // sprintf(fname,"%1.2f",e->m[n]->DCS->idet); 00388 // TObjString * idets = new TObjString(fname); 00389 // idets->Write("IDET"); 00390 // delete idets; 00391 00392 // sprintf(fname,"%1.2f",e->m[n]->DCS->vcc); 00393 // TObjString * vccs = new TObjString(fname); 00394 // vccs->Write("VCC"); 00395 // delete vccs; 00396 00397 // sprintf(fname,"%3.0f",e->m[n]->DCS->icc); 00398 // TObjString * iccs = new TObjString(fname); 00399 // iccs->Write("ICC"); 00400 // delete iccs; 00401 00402 // sprintf(fname,"%1.2f",e->m[n]->DCS->vdd); 00403 // TObjString * vdds = new TObjString(fname); 00404 // vdds->Write("VDD"); 00405 // delete vdds; 00406 00407 // sprintf(fname,"%3.0f",e->m[n]->DCS->idd); 00408 // TObjString * idds = new TObjString(fname); 00409 // idds->Write("IDD"); 00410 // delete idds; 00411 00412 // e->m[n]->DCS->Write(); //stream the DCS object 00413 00414 // if(accbst && e->m[n]->present){ 00415 // e->m[n]->h_accbst0->Write(); 00416 // e->m[n]->h_accbst1->Write(); 00417 // } 00418 // else{ 00419 // e->m[n]->h_scan0->Write("h_scan0"); 00420 // e->m[n]->h_scan1->Write("h_scan1"); 00421 00422 // if(e->nSCTLV>0){ 00423 // gr = e->m[n]->GetIddGraph(); 00424 // gr->Write("Idd"); 00425 // gr = e->m[n]->GetIccGraph(); 00426 // gr->Write("Icc"); 00427 // } 00428 // if(e->nSCTHV>0 || e->m[n]->DCS->hv_source==2){ 00429 // gr = e->m[n]->GetIdetGraph(); 00430 // gr->Write("Idet"); 00431 // } 00432 00433 // if(write_fits){ 00434 // e->m[n]->h_mean0->Write("h_mean0"); 00435 // e->m[n]->h_mean1->Write("h_mean1"); 00436 // e->m[n]->h_sigma0->Write("h_sigma0"); 00437 // e->m[n]->h_sigma1->Write("h_sigma1"); 00438 // e->m[n]->h_code0->Write("h_code0"); 00439 // e->m[n]->h_code1->Write("h_code1"); 00440 // e->m[n]->h_chisq0->Write("h_chisq0"); 00441 // e->m[n]->h_chisq1->Write("h_chisq1"); 00442 // e->m[n]->h_fom0->Write("h_fom0"); 00443 // e->m[n]->h_fom1->Write("h_fom1"); 00444 // } 00445 // } 00446 00447 // // TODO: Write the next three hists at each EOB 00448 // // This code will write the hists to file only 00449 // // for the LAST burst of each scan 00450 00451 // if((e->burst_type == 100)||(e->burst_type == 102)||(e->burst_type==21)) { // decoded burst or decoded vburst 00452 // e->m[n]->h_cluster0->Write("h_cluster0"); 00453 // e->m[n]->h_cluster1->Write("h_cluster1"); 00454 // e->m[n]->h_corr->Write("h_corr"); 00455 00456 // if(e->do_fill_evtree){ 00457 // if(e->m[n]->evtree!=0){ 00458 // sprintf(fname,"EvTree_m%d",n); 00459 // e->m[n]->evtree->Write(fname); 00460 // } 00461 // } 00462 // } 00463 // // } 00464 // } 00465 00466 // e->h_scan_tsent->Write(); 00467 // for (n=0; n<e->nMuSTARDs; n++){ 00468 // e->h_scan_evcnt[n]->Write("h_scan_evcnt"); 00469 // e->h_scan_ercnt[n]->Write("h_scan_ercnt"); 00470 // e->h_scan_tocnt[n]->Write("h_scan_tocnt"); 00471 // e->h_scan_xecnt[n]->Write("h_scan_xecnt"); 00472 // } 00473 00474 // out->Close(); 00475 00476 00477 // sprintf(fname, "%sstlog%d.txt",DATA_DIRECTORY,e->runnum); 00478 00479 // FILE *logfile; 00480 // logfile = fopen(fname,"a+"); 00481 00482 // fprintf(logfile,"runnum %u\n",e->runnum); 00483 // fprintf(logfile,"scannum %u\n",e->scannum); 00484 // fprintf(logfile,"date %u\n",dt->GetDate()); 00485 // fprintf(logfile,"time %u\n",dt->GetTime()); 00486 // fprintf(logfile,"scan_type %u\n",e->scan_type); 00487 // fprintf(logfile,"scan_start %6.2f\n",e->scan_start); 00488 // fprintf(logfile,"scan_stop %6.2f\n",e->scan_stop); 00489 // fprintf(logfile,"scan_step %6.2f\n",e->scan_step); 00490 // fprintf(logfile,"run_tsent %u\n",e->run_tsent); 00491 // fprintf(logfile,"run_evcnt %u\n",e->run_evcnt); 00492 // fprintf(logfile,"run_ercnt %u\n",e->run_ercnt); 00493 // fprintf(logfile,"run_tocnt %u\n",e->run_tocnt); 00494 00495 // fclose(logfile); 00496 00497 // delete dt; // PWP 20.12.01 00498 // delete dts; 00499 // delete pls; 00500 // delete host; 00501 // delete user; 00502 // } 00503 00504 // void st_dcs_query() { 00505 // int moi; 00506 00507 // printf("Show DCS for module (int) ?"); 00508 // scanf("%d",&moi); 00509 00510 // if((moi>=0)&&(moi<e->GetMaxModules())){ 00511 // e->m[moi]->DCS->Print(); 00512 // } else { 00513 // printf("Sorry, module %d out of range\n",moi); 00514 // } 00515 // } 00516 00517 // void st_dcs_log() { 00518 // int moi; 00519 // float tmp[6]; 00520 00521 // printf("\nModule-specific DCS-Information:\n\n"); 00522 // printf("Module\t\tVcc\tIcc\tVdd\tIdd\tVdet\tIdet\tThyb1\tThyb2\n"); 00523 00524 // for(moi=0;moi<e->GetMaxModules();moi++){ // was e->num_showmods PWP 11.02.03 00525 // if(e->m[moi]->present) { 00526 // e->m[moi]->DCS->Query(); 00527 // printf("%s\t%.2f\t%.0f\t%.2f\t%.0f\t%.1f\t%.2f\t%.2f\t%.2f\n", 00528 // e->m[moi]->name,e->m[moi]->DCS->vcc,e->m[moi]->DCS->icc, 00529 // e->m[moi]->DCS->vdd,e->m[moi]->DCS->idd, 00530 // e->m[moi]->DCS->vdet,e->m[moi]->DCS->idet, 00531 // e->m[moi]->DCS->T1,e->m[moi]->DCS->T2); 00532 // } 00533 // } 00534 00535 // if(st_get_dcsrem(tmp)){ 00536 // printf("\nEnvironmental DCS-Information:\n\n"); 00537 // printf("Tamb1\tTamb2\tTamb3\tHum\tTpipe\n"); 00538 // printf("%.1f\t%.1f\t%.1f\t%.1f\t%.1f\n\n", 00539 // tmp[0],tmp[1],tmp[2],tmp[3],tmp[4]); 00540 // } 00541 00542 // } 00543 00544 // void st_show_sc() { 00545 // int moi,loi; 00546 00547 // printf("Show s curves for module (int) ?"); 00548 // scanf("%d",&moi); 00549 00550 // printf("link ?"); 00551 // scanf("%d",&loi); 00552 00553 // gROOT->ProcessLine(".L stan_scurves.cpp"); 00554 // stan_scurves(moi,loi); 00555 // } 00556 00557 00558 // links to production test macros 00559 // added PWP 16.11.00 00560 00561 // void st_tm(){ 00562 // gROOT->ProcessLine(".L StreamDelay.cpp"); 00563 // StreamDelay(0); 00564 // } 00565 00566 // void st_iv(){ 00567 // gROOT->ProcessLine(".L IVCurve.cpp"); 00568 // IVCurve(); 00569 // } 00570 00571 // void st_hr(){ 00572 // gROOT->ProcessLine(".L HardReset.cpp"); 00573 // HardReset(); 00574 // } 00575 00576 // void st_fbt(){ 00577 // gROOT->ProcessLine(".L FullBypassTest.cpp"); 00578 // FullBypassTest(); 00579 // } 00580 00581 // void st_bt(){ 00582 // gROOT->ProcessLine(".L BypassTest.cpp"); 00583 // BypassTest(); 00584 // } 00585 00586 // void st_rt(){ 00587 // gROOT->ProcessLine(".L RedundancyTest.cpp"); 00588 // RedundancyTest(); 00589 // } 00590 00591 // void st_pt(){ 00592 // gROOT->ProcessLine(".L PipelineTest.cpp"); 00593 // PipelineTest(); 00594 // } 00595 00596 void api_sd(){ 00597 gROOT->ProcessLine(".X strobe.cxx"); 00598 // StrobeDelay(1); 00599 } 00600 00601 void api_tpg(){ 00602 gROOT->ProcessLine(".X 3pt.cxx"); 00603 } 00604 00605 // void st_tr(){ 00606 // gROOT->ProcessLine(".L TrimRange.cxx"); 00607 // TrimRange(); 00608 // } 00609 00610 void api_rc(){ 00611 gROOT->ProcessLine(".X reponse.cxx"); 00612 } 00613 00614 void api_nmask(){ 00615 gROOT->ProcessLine(".X nmask.cxx"); 00616 } 00617 00618 // void st_no(Int_t go_slow=0, Int_t do_qthr=0){ 00619 // gROOT->ProcessLine(".L No.cxx"); 00620 // No(go_slow,do_qthr); 00621 // } 00622 00623 // void st_tw(){ 00624 // gROOT->ProcessLine(".L Timewalk.cxx"); 00625 // Timewalk(1); // find 1fC point by threshold scan 00626 // } 00627 00628 // void st_characterisation(){ 00629 // gROOT->ProcessLine(".L CharacterisationTest.cxx"); 00630 // CharacterisationTest(); 00631 // } 00632 00633 // void st_confirmation(){ 00634 // gROOT->ProcessLine(".L ConfirmationTest.cxx"); 00635 // ConfirmationTest(); 00636 // } 00637 00638 // void st_cltt(){ 00639 // gROOT->ProcessLine(".L HybridColdTest.cxx"); 00640 // HybridColdTest(); 00641 // } 00642 00643 int buttons_partition = 0; 00644 int buttons_crate = 0; 00645 int buttons_rod = 0; 00646 00647 int getPartition() { 00648 return buttons_partition; 00649 } 00650 00651 int getCrate() { 00652 return buttons_crate; 00653 } 00654 00655 int getRodNumber() { 00656 return buttons_rod; 00657 }