@@ -54,53 +54,6 @@ int[] getSorted(int... index) {
5454 static ArrayList <SortedBank > banksB = new ArrayList <>();
5555 static HashMap <String , HashMap <String , Integer >> badEntries = new HashMap <>();
5656
57- public static void main (String args []) {
58-
59- OptionParser op = new OptionParser ("hipo-diff" );
60- op .addOption ("-t" , "0.00001" , "absolute tolerance for comparisons" );
61- op .addOption ("-n" , "-1" , "number of events" );
62- op .addOption ("-q" , null , "quiet mode" );
63- op .addOption ("-Q" , null , "verbose mode" );
64- op .addOption ("-b" , null , "name of bank to diff" );
65- op .addOption ("-s" , null , "sort on column index" );
66- op .setRequiresInputList (true );
67- op .parse (args );
68- if (op .getInputList ().size () != 2 ) {
69- System .out .println (op .getUsageString ());
70- System .out .println ("ERROR: Exactly 2 input files are required." );
71- System .exit (1 );
72- }
73-
74- if (op .getOption ("-s" ).stringValue () != null ) {
75- String [] stmp = op .getOption ("-s" ).stringValue ().split ("," );
76- sortIndex = new int [stmp .length ];
77- for (int i = 0 ; i < stmp .length ; i ++) sortIndex [i ] = Integer .parseInt (stmp [i ]);
78- }
79- verboseMode = op .getOption ("-Q" ).stringValue () != null ;
80- quietMode = op .getOption ("-q" ).stringValue () != null ;
81- nmax = op .getOption ("-n" ).intValue ();
82- tolerance = op .getOption ("-t" ).doubleValue ();
83-
84- HipoReader readerA = new HipoReader ();
85- HipoReader readerB = new HipoReader ();
86- readerA .open (op .getInputList ().get (0 ));
87- readerB .open (op .getInputList ().get (1 ));
88- SchemaFactory sf = readerA .getSchemaFactory ();
89- runConfigBank = new Bank (sf .getSchema ("RUN::config" ));
90-
91- if (op .getOption ("-b" ).stringValue () == null ) {
92- for (Schema s : sf .getSchemaList ()) {
93- banksA .add (new SortedBank (s ));
94- banksB .add (new SortedBank (s ));
95- }
96- } else {
97- banksA .add (new SortedBank (sf .getSchema (op .getOption ("-b" ).stringValue ())));
98- banksB .add (new SortedBank (sf .getSchema (op .getOption ("-b" ).stringValue ())));
99- }
100-
101- compare (readerA , readerB );
102- }
103-
10457 public static void compare (HipoReader a , HipoReader b ) {
10558 Event eventA = new Event ();
10659 Event eventB = new Event ();
@@ -208,4 +161,52 @@ public static void compare(SortedBank a, SortedBank b) {
208161 }
209162 }
210163 }
164+
165+ public static void main (String args []) {
166+
167+ OptionParser op = new OptionParser ("hipo-diff" );
168+ op .addOption ("-t" , "0.00001" , "absolute tolerance for comparisons" );
169+ op .addOption ("-n" , "-1" , "number of events" );
170+ op .addOption ("-q" , null , "quiet mode" );
171+ op .addOption ("-Q" , null , "verbose mode" );
172+ op .addOption ("-b" , null , "name of bank to diff" );
173+ op .addOption ("-s" , null , "sort on column index" );
174+ op .setRequiresInputList (true );
175+ op .parse (args );
176+ if (op .getInputList ().size () != 2 ) {
177+ System .out .println (op .getUsageString ());
178+ System .out .println ("ERROR: Exactly 2 input files are required." );
179+ System .exit (1 );
180+ }
181+
182+ if (op .getOption ("-s" ).stringValue () != null ) {
183+ String [] stmp = op .getOption ("-s" ).stringValue ().split ("," );
184+ sortIndex = new int [stmp .length ];
185+ for (int i = 0 ; i < stmp .length ; i ++) sortIndex [i ] = Integer .parseInt (stmp [i ]);
186+ }
187+ verboseMode = op .getOption ("-Q" ).stringValue () != null ;
188+ quietMode = op .getOption ("-q" ).stringValue () != null ;
189+ nmax = op .getOption ("-n" ).intValue ();
190+ tolerance = op .getOption ("-t" ).doubleValue ();
191+
192+ HipoReader readerA = new HipoReader ();
193+ HipoReader readerB = new HipoReader ();
194+ readerA .open (op .getInputList ().get (0 ));
195+ readerB .open (op .getInputList ().get (1 ));
196+ SchemaFactory sf = readerA .getSchemaFactory ();
197+ runConfigBank = new Bank (sf .getSchema ("RUN::config" ));
198+
199+ if (op .getOption ("-b" ).stringValue () == null ) {
200+ for (Schema s : sf .getSchemaList ()) {
201+ banksA .add (new SortedBank (s ));
202+ banksB .add (new SortedBank (s ));
203+ }
204+ } else {
205+ banksA .add (new SortedBank (sf .getSchema (op .getOption ("-b" ).stringValue ())));
206+ banksB .add (new SortedBank (sf .getSchema (op .getOption ("-b" ).stringValue ())));
207+ }
208+
209+ compare (readerA , readerB );
210+ }
211+
211212}
0 commit comments