// N.Kurz, EE, GSI, 27-Nov-2014 //------------------------------------------------------------- // Go4 Release Package v3.03-05 (build 30305) // 05-June-2008 //--------------------------------------------------------------- // The GSI Online Offline Object Oriented (Go4) Project // Experiment Data Processing at EE department, GSI //--------------------------------------------------------------- // //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI // Planckstr. 1, 64291 Darmstadt, Germany //Contact: http://go4.gsi.de //---------------------------------------------------------------- //This software can be used under the license agreements as stated //in Go4License.txt file which is part of the distribution. //---------------------------------------------------------------- #ifndef TUNPACKPROCESSOR_H #define TUNPACKPROCESSOR_H //#define WR_TIME_STAMP 1 // white rabbit time stamp is head of data //#define USE_MBS_PARAM 1 // /* switch between "signal to background" or "signal minus background" spill decision*/ #define USE_SIGNALTOBACK_RATIO 1 // defined in event structure: //#define MAX_SFP 4 //#define MAX_SLAVE 16 //#define N_CHA 16 #ifdef WR_TIME_STAMP #define SUB_SYSTEM_ID 0x100 // sub-system identifier pci express #define TS__ID_L16 0x0f7 #define TS__ID_M16 0x1f7 #define TS__ID_H16 0x2f7 #endif // WR_TIME_STAMP #define ADC_RES 2000./16384. // mV #ifdef USE_MBS_PARAM #define MAX_TRACE_SIZE 8000 // in samples #define MAX_TRAPEZ_N_AVG 1000 // in samples #else #define TRACE_SIZE 8000 //8000 // in samples #define TRAPEZ_N_AVG 64 // in samples // nr of slaves on SFP 0 1 2 3 // | | | | // #define NR_SLAVES { 0, 9, 0, 0} // #define ADC_TYPE { 0, 0xffff, 0, 0} // 12 bit: 0, 14 bit: 1 // // bit 0 fuer slave module 0 // // bit n fuer slave module n (max n = 31) // JAM 2-2025: below for ipm //#define NR_SLAVES { 0, 0, 0, 3} // JAM 5-25 - actual setup 16-may-25 #define NR_SLAVES { 0, 0, 0, 2} #define ADC_TYPE { 0xffff, 0xffff, 0xffff, 0xffff} // 12 bit: 0, 14 bit: 1 #endif // defined in event structure now: //#define CSA_BASE_START 20 //#define CSA_BASE_SIZE 1400 //#define CSA_SIGNAL_START 1600 //#define CSA_SIGNAL_SIZE 1400 #define RON "\x1B[7m" #define RES "\x1B[0m" #define BASE_LINE_SUBT_START 0 #define BASE_LINE_SUBT_SIZE 150 #include "TGo4EventProcessor.h" #include "TAwagsSisBasicEvent.h" class TAwagsSisParam; class TAwagsSisProc : public TGo4EventProcessor { public: TAwagsSisProc() ; TAwagsSisProc(const char* name); virtual ~TAwagsSisProc() ; Bool_t BuildEvent(TGo4EventElement* target); // event processing function protected: /* dynamically init histograms. formerly known as f_init_histo*/ void InitDisplay (Int_t); /* treat signal and background regions for average heights * Returns average of signal to background for all channels */ Double_t HandleSignalToBackground(); /* here put together MBS events to spill traces and trends*/ void EvaluateSpills(Double_t threshold); private: TGo4MbsEvent *fInput; //! TAwagsSisBasicEvent *fOutput; TAwagsSisParam* fPar; Bool_t fNewSpill; //!< flag for begin of new spill Bool_t fInSpill; //!< flag which is on during spill signals Int_t fiEventInSpill; //!< index of MBS event in the spill /** remember the last state of background measurment, to clear the previous values */ Bool_t fLastBackgroundMeasurmentState; Double_t fDeltaQ[MAX_SFP][MAX_SLAVE][N_CHA]; //!< relative charge difference ("sig minus back" value) TH1 *h_spill_scaler; //!< count spills and events TH1 *h_spill_size; //!< sizes of spills in mbs events TH1 *h_signal_to_background_ave; //!