5656import org .jlab .utils .benchmark .BenchmarkTimer ;
5757import org .jlab .utils .options .OptionParser ;
5858
59-
59+
6060/**
6161 *
6262 * @author ziegler
@@ -225,8 +225,8 @@ public void initMenus() {
225225
226226 String [] triggers = { "Electron OR" , "Electron Sec 1" ,"Electron Sec 2" ,"Electron Sec 3" ,
227227 "Electron Sec 4" ,"Electron Sec 5" ,"Electron Sec 6" ,
228- "" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,
229- "Random Pulser" };
228+ "" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,
229+ "Random Pulser" };
230230
231231 JMenu trigBitsBeam = new JMenu ("TriggerBits" );
232232 trigBitsBeam .getAccessibleContext ().setAccessibleDescription ("Select Trigger Bits" );
@@ -251,7 +251,6 @@ public void itemStateChanged(ItemEvent e) {
251251 boolean bstate = ((this .triggerMask >> i ) & 1 ) == 1 ;
252252 bb .setState (bstate );
253253 trigBitsBeam .add (bb );
254-
255254 }
256255 menuBar .add (trigBitsBeam );
257256 }
@@ -544,13 +543,19 @@ private int getEventNumber(DataEvent event) {
544543 return bank != null ? bank .getInt ("event" , 0 ): this .eventCounter ;
545544 }
546545
546+ private int getEventNumber (Event event ) {
547+ Bank bank = new Bank (schemaFactory .getSchema ("RUN::config" ));
548+ event .read (bank );
549+ return bank .getRows ()>0 ? bank .getInt ("event" , 0 ): this .eventCounter ;
550+ }
551+
547552 private void copyHitList (String k , String mon1 , String mon2 ) {
548- if (k == null ? mon1 != null : !k .equals (mon1 )) return ;
549- this .monitors .get (mon1 ).ttdcs = this .monitors .get (mon2 ).ttdcs ;
550- this .monitors .get (mon1 ).ftdcs = this .monitors .get (mon2 ).ftdcs ;
551- this .monitors .get (mon1 ).fadcs = this .monitors .get (mon2 ).fadcs ;
552- this .monitors .get (mon1 ).fapmt = this .monitors .get (mon2 ).fapmt ;
553- this .monitors .get (mon1 ).ftpmt = this .monitors .get (mon2 ).ftpmt ;
553+ if (k == null ? mon1 != null : !k .equals (mon1 )) return ;
554+ this .monitors .get (mon1 ).ttdcs = this .monitors .get (mon2 ).ttdcs ;
555+ this .monitors .get (mon1 ).ftdcs = this .monitors .get (mon2 ).ftdcs ;
556+ this .monitors .get (mon1 ).fadcs = this .monitors .get (mon2 ).fadcs ;
557+ this .monitors .get (mon1 ).fapmt = this .monitors .get (mon2 ).fapmt ;
558+ this .monitors .get (mon1 ).ftpmt = this .monitors .get (mon2 ).ftpmt ;
554559 }
555560
556561
@@ -564,21 +569,12 @@ public void dataEventAction(DataEvent event) {
564569 if (beamMonitor != null && !beamMonitor .getBeamStatus ()) {
565570 return ;
566571 }
567-
572+
568573 // convert event to HIPO:
569- DataEvent hipo = event ;
574+ DataEvent hipo = event ;
570575 if (event instanceof EvioDataEvent ) {
571- Event dump = this .clasDecoder .getDataEvent (event );
572- Bank header = this .clasDecoder .createHeaderBank (this .ccdbRunNumber , getEventNumber (event ), (double )0 , (double )0 );
573- Bank trigger = this .clasDecoder .createTriggerBank ();
574- Bank helicity = this .clasDecoder .createHelicityDecoderBank ((EvioDataEvent )event );
575- Bank onlineHelicity = this .clasDecoder .createOnlineHelicityBank ();
576- if (onlineHelicity !=null ) dump .write (onlineHelicity );
577- if (header != null ) dump .write (header );
578- if (trigger != null ) dump .write (trigger );
579- if (helicity != null ) dump .write (helicity );
580- this .clasDecoder .extractPulses (dump ); // Apply AHDC Decoder !!!
581- hipo = new HipoDataEvent (dump , this .schemaFactory );
576+ Event dump = this .clasDecoder .getDecodedEvent ((EvioDataEvent )event , this .ccdbRunNumber , eventCounter , (double )0 , (double )0 );
577+ hipo = new HipoDataEvent (dump , this .schemaFactory );
582578 }
583579
584580 // if header bank is missing, do nothing
@@ -999,5 +995,5 @@ else if (parser.getOption("-batch").intValue() != 0) {
999995 public void processShape (DetectorShape2D dsd ) {
1000996 throw new UnsupportedOperationException ("Not supported yet." ); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
1001997 }
1002-
998+
1003999}
0 commit comments