void DBUpload_Hybrid(Char_t* f_stub) { // DBUpload_Hybrid.cpp // A simple wrapper to a java application to upload SCTDAQ barrel hybrid test data to the // SCT database. // // version 0.1 DR 06/01/03 // version 0.2 JF 20/03/03 Bug fix to archive_dir // version 0.3 DR 26/05/03 Bug fix - declare archive variable // // Usage: // // DBUpload_Hybrid(result_filename) eg DBUpload("20220330200013_20021211.txt") // - uploads all tests in that filename // DBUpload_Hybrid(serialno) eg DBUpload("20220330200013") // - uploads all tests for that module/hybrid serial number for all dates // eg all filenames of the form 20220330200013_yyyymmdd.txt // DBUpload_Hybrid() // - uploads all tests for all modules/hybrids performed on the current day // eg all filenames of the form dddddddddddddd_yyyymmdd.txt where yyyymmdd is the current day // // Result files are retrieved from RESULTS_DIRECTORY as defined in parameters.h, but only if there is no ARCHIVE_DIRECTORY env variable set // OR if the ARCHIVE_DIRECTORY env variable is set to "" (empty string). // If the ARCHIVE_DIRECTORY env variable is set to a non-empty string, the files are retrieved from the ARCHIVE_DIRECTORY env variable. // // Important: if device is a barrel, all serial numbers of the form 20220330200011 are converted to 20220338200011 // // // Important: Requires jSCTDAQ.jar downloadable from http://www.hep.phy.cam.ac.uk/~silicon/jSCTDAQ.html // Also the following two files from the Geneva SCT database website at // http://melb.unige.ch:3143/phyprdwww/sctprd/doc/otherlinks/java_app/index.html // classes111.zip - JDBC classes (do not unzip) // SCT_SCTTESTS_3_nn_P.jar - java upload utilities (latest version at the time of writing nn=17) // // // You must set your classpath environment variable to include the three // files jSCTDAQ.jar, SCTTESTS_17_P.jar and classes111.zip // To check if you classpath is set up correctly, I recommend that before starting SCTDAQ, open a DOS window or console, and // type 'java DBUpload/uploadSCTDAQ' to check if it runs ok (you should get a print out of the required argument list) // #ifdef RESULTS_DIRECTORY // do not reload parameters.h #else // must load parameters.h to get results and upload directories #include #endif Char_t archive[256]=""; Char_t* archivedir = gSystem->Getenv("ARCHIVE_DIRECTORY"); if(archivedir!=NULL) { strcpy(archive,archivedir); } else strcpy(archive,"null"); Char_t line[256]; sprintf(line,"java DBUpload/uploadSCTDAQ %s %s %s %s hybrid",RESULTS_DIRECTORY,UPLOAD_DIRECTORY,archive,f_stub); printf("Invoking java application to verify and upload SCTDAQ data...\n"); gSystem->Exec(line); } void DBUpload_Hybrid() { DBUpload_Hybrid("null"); }