/** ModuleRawData.java Pixel database, java application PDB query. Ancillary class to recover raw data from module test Author : Attilio.Andreazza@mi.infn.it Created : 08-08-2005 Updated : 10-11-2005 (missing closing statement) Updated : 14-11-2005 (GotData() function to keep track if raw data access was successful) **/ import PIXLibrary.*; import java.util.StringTokenizer; import java.lang.*; import java.sql.*; import java.io.*; public class ModuleRawData { final static int ALL=-1; final static int OR = 1; final static int AND= 2; final static int CHIPS= 16; final static int COLS = 18; final static int ROWS =160; private boolean gotData = false; public boolean GotData() { return gotData; } // Array of failed cuts, not directly accessible protected long [][][] FailedCuts= new long [CHIPS][COLS][ROWS]; //------------------------------------------------ // Default constructor: whole array set to 0 //------------------------------------------------ public ModuleRawData() { gotData=false; for (int i=0; i0 ) { outfile.println(i+" "+j+" "+k+" " +FailedCuts[i][j][k]); line++; } } } } outfile.close(); return line; } catch (Exception exception) { System.err.println("Unable to write to file" +Filename+": " +exception); return -1; } } //------------------------------------------------ // Access information for a single pixel //------------------------------------------------ public long GetCode(int chip, int column, int row) { return FailedCuts[chip][column][row]; } //------------------------------------------------ // Count pixels failing a certain set cuts. // chip can be: // a number for 0 to ModuleRawData.CHIPS-1 // if a apecific chip is requested // ModuleRawData.ALL if all chips are to be checked. // operation can be: // ModuleRawData.OR (the pixel fails at least one // cut of the bitted word) // ModuleRawData.AND (the pixel fails all the // cuts of the bitted word) //------------------------------------------------ public int Count(int chip, long bittedCuts, int operation) { int counter = 0; int minchip, maxchip; if ( chip==ALL) { minchip=0; maxchip=CHIPS; } else if ( chip>=0 && chip=0 && chip