Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

CheckRaw.java

00001 import Sct.IS.*;
00002 import Sct.*;
00003 import SctData.*;
00004 import hep.aida.*;
00005 import hep.aida.ref.histogram.*;
00006 
00007 public class CheckRaw {
00008     public int runNumber;
00009     public int scanNumber;
00010     public String moduleName;
00011     public byte groupID;
00012     public float chip5CalFactor;
00013     public byte chip4Target;
00014     public byte chip11Threshold;
00015     public byte chip0Chan0Trim;
00016     public int nPoints;
00017     public double point0;
00018     public double bin00;
00019     public double bin4930;
00020     public int exitCode = 0;
00021     RawScanResult r;
00022     
00023     public void compare(String name) throws java.io.IOException{
00024         Serializable s = ObjectManagerIS.getInstance().readObject(name);
00025         System.out.println(name + "  " + s.getClassName());
00026         r = (RawScanResult)s;
00027         
00028         if (r.getHeader().getRunNumber() != runNumber) {
00029             System.err.println("RunNumber not equal. Got: " + r.getHeader().getRunNumber() + " expected: " + runNumber);
00030             ++exitCode;
00031         }
00032         
00033         if (r.getHeader().getScanNumber() != scanNumber) {
00034             System.err.println("ScanNumber not equal. Got: " + r.getHeader().getScanNumber() + " expected: " + scanNumber);
00035             ++exitCode;
00036         }
00037 
00038         if (!r.getHeader().getModuleName().equals(moduleName)) {
00039             System.err.println("ModuleName not equal. Got: " + r.getHeader().getModuleName() + " expected: " + moduleName);
00040             ++exitCode;
00041         }
00042 
00043         if (r.getConfiguration().getGroupId() != groupID) {
00044             System.err.println("GroupId not equal. Got: " + r.getConfiguration().getGroupId() + " expected: " + groupID);
00045             ++exitCode;    
00046         }
00047         if (r.getConfiguration().getChipConfiguration(5).getCalFactor() != chip5CalFactor) {
00048             System.err.println("chip5CalFactor not equal. Got: " + r.getConfiguration().getChipConfiguration(5).getCalFactor() + " expected: " + chip5CalFactor);
00049             ++exitCode;    
00050         }
00051         if (r.getConfiguration().getChipConfiguration(4).getTrimTarget() != chip4Target) {
00052             System.err.println("chip4Target not equal. Got: " + r.getConfiguration().getChipConfiguration(4).getTrimTarget() + " expected: " + chip4Target);
00053             ++exitCode;    
00054         }
00055         if (r.getConfiguration().getChipConfiguration(11).getThreshold() != chip11Threshold) {
00056             System.err.println("chip11Threshold not equal. Got: " + r.getConfiguration().getChipConfiguration(11).getThreshold() + " expected: " + chip11Threshold);
00057             ++exitCode;    
00058         }       
00059         if (r.getConfiguration().getChipConfiguration(0).getTrim(0) != chip0Chan0Trim) {
00060             System.err.println("chip0Chan0Trim not equal. Got: " + r.getConfiguration().getChipConfiguration(0).getTrim(0) + " expected: " + chip0Chan0Trim);
00061             ++exitCode;    
00062         }
00063         
00064         if (r.getPoints().getNPoints() != nPoints) {
00065             System.err.println("nPoints not equal. Got: " + r.getPoints().getNPoints() + " expected: " + nPoints);
00066             ++exitCode;        
00067         }
00068         if (r.getPoints().getPoint(0) != point0) {
00069             System.err.println("point0 not equal. Got: " + r.getPoints().getPoint(0) + " expected: " + point0);
00070             ++exitCode;        
00071         }
00072         
00073         if (r.getData().binHeight(0, 0) != bin00) {
00074             System.err.println("bin00 not equal. Got: " + r.getData().binHeight(0, 0) + " expected: " + bin00);
00075             ++exitCode; 
00076         }
00077         if (r.getData().binHeight(768+49, 30) != bin4930) {
00078             System.err.println("bin4930 not equal. Got: " + r.getData().binHeight(768+49, 30) + " expected: " + bin4930);
00079             ++exitCode; 
00080         }
00081     }
00082     
00083     public void plot() {
00084         IAnalysisFactory af = IAnalysisFactory.create();
00085         ITree tree = af.createTreeFactory().create();            
00086 
00087         // Create an IPlotter 
00088         IPlotter iplotter = af.createPlotterFactory().create();  
00089         iplotter.show();
00090         iplotter.createRegion().plot(r.getData());
00091     }
00092     
00093         public static void main(String[] args) {
00094         CheckRaw cr = new CheckRaw();
00095         try {
00096             cr.runNumber = 1047;
00097             cr.scanNumber = 6;
00098             cr.moduleName = "20220330200015";
00099             cr.groupID = 0;
00100             cr.chip5CalFactor = 1.0f;
00101             cr.chip4Target = 38;
00102             cr.chip11Threshold = 38;
00103             cr.chip0Chan0Trim = 2;      
00104             cr.nPoints = 57;
00105             cr.point0 = 60;     
00106             cr.bin00 = 1000;    
00107             cr.bin4930 = 209;
00108             cr.compare("EventData.SctData::RawScanResult.1047.6.20220330200015");
00109         
00110             cr.runNumber = 1048;
00111             cr.scanNumber = 16;
00112             cr.moduleName = "20220330200015";
00113             cr.groupID = 0;
00114             cr.chip5CalFactor = 1.0f;
00115             cr.chip4Target = 38;
00116             cr.chip11Threshold = 38;
00117             cr.chip0Chan0Trim = 2;      
00118             cr.nPoints = 57;
00119             cr.point0 = 60;     
00120             cr.bin00 = 1000;    
00121             cr.bin4930 = 209;
00122             cr.compare("EventData.SctData::RawScanResult.1048.16.20220330200015");
00123             
00124             /*cr.runNumber = 0;
00125             cr.scanNumber = 2;
00126             cr.moduleName = "20220170100053";
00127             cr.groupID = 0;
00128             cr.chip5CalFactor = 1.0f;
00129             cr.chip4Target = 0;
00130             cr.chip11Threshold = -56;
00131             cr.chip0Chan0Trim = 7;      
00132             cr.nPoints = 32;
00133             cr.point0 = 0;      
00134             cr.bin00 = 0;       
00135             cr.bin4930 = 0;
00136             cr.compare("EventData.SctData::RawScanResult.0.2.20220170100053");
00137             
00138             cr.runNumber = 1;
00139             cr.scanNumber = 1;
00140             cr.moduleName = "20220170100053";
00141             cr.groupID = 0;
00142             cr.chip5CalFactor = 1.0f;
00143             cr.chip4Target = 0;
00144             cr.chip11Threshold = 40;
00145             cr.chip0Chan0Trim = 7;      
00146             cr.nPoints = 64;
00147             cr.point0 = 0;      
00148             cr.bin00 = 0;       
00149             cr.bin4930 = 200;
00150             cr.compare("EventData.SctData::RawScanResult.1.1.20220170100053");
00151             
00152             
00153             cr.runNumber = 1;
00154             cr.scanNumber = 3;
00155             cr.moduleName = "20220170100053";
00156             cr.groupID = 0;
00157             cr.chip5CalFactor = 1.0f;
00158             cr.chip4Target = 0;
00159             cr.chip11Threshold = 40;
00160             cr.chip0Chan0Trim = 7;      
00161             cr.nPoints = 64;
00162             cr.point0 = 0;      
00163             cr.bin00 = 0;       
00164             cr.bin4930 = 1000;
00165             cr.compare("EventData.SctData::RawScanResult.1.3.20220170100053");
00166             
00167             
00168             cr.runNumber = 1;
00169             cr.scanNumber = 4;
00170             cr.moduleName = "20220170100028";
00171             cr.groupID = 2;
00172             cr.chip5CalFactor = 1.0f;
00173             cr.chip4Target = 0;
00174             cr.chip11Threshold = 40;
00175             cr.chip0Chan0Trim = 4;      
00176             cr.nPoints = 64;
00177             cr.point0 = 0;      
00178             cr.bin00 = 0;       
00179             cr.bin4930 = 995;
00180             cr.compare("EventData.SctData::RawScanResult.1.4.20220170100028");     
00181             */
00182         } catch (Exception e) {
00183             e.printStackTrace();
00184             System.exit(2);
00185         }
00186         
00187         if (args.length > 0) cr.plot();
00188         else System.exit(cr.exitCode);
00189     }
00190 
00191 }
00192 

Generated on Thu Jul 15 09:55:40 2004 for SCT DAQ/DCS Software - Java by doxygen 1.3.5