//------------------------------------------------------------------------------ // DAQ application task -- // (C) Devis Contarato 2009, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "task_DAQ_Main.h" // [Author] "Devis Contarato" // [Version] "0.5" // [Modified by] "Devis Contarato" // [Last revision] "23 Mar 2009" // [Language] "C++" // [Compiler] "Visual C++ 8.x 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "DAQ application task" // [Key documentation] // "Visual C++ Reference Help" // {Trace} //______________________________________________________________________________ // Overloading check #ifndef task_DAQ_Main_H #define task_DAQ_Main_H // Standard components //#include #include #include // Root components #include // Application components #include "task_DAQ_Detector.h" #include "task_DAQ_GUI.h" // Data #include "data_Burst.h" #include "geom_Frame.h" // ROOT #include "TStyle.h" #include "TFile.h" #include "TTree.h" //______________________________________________________________________________ class task_DAQ_Main: public task_Object { private: task_DAQ_Detector* task_Det; // Detector setup task task_DAQ_GUI* task_GUI; // GUI setup task ////////////////// // DATA objects // ////////////////// data_Burst* burst_Raw; // Raw data container data_Burst* burst_Image; // Container for processed data image (pedestal, common mode subtracted, etc data_Burst* burst_Pedestal; // Pedestals data_Burst* burst_Pedestal2; // Pedestals^2 data_Burst* burst_Noise; // Noise data_Burst* burst_Mask; // Pixel mask std::vector common_Mode; // Store common mode values for various frames std::vector common_ModeNoise; // Store common mode noise values for various frames ////////////////////////////////////////////// // COMM variables for DAQ run-time settings // ////////////////////////////////////////////// UInt_t trigger_mode, trigger_source, trigger_period; UInt_t driver_number, driver_delay, frames_number, data_source; UInt_t iadc; // counter of number of ADC channels selected UInt_t adc_divider, adc_averages; UInt_t burst_Count, run_Number, event_Number; UInt_t runFlag, endFlag, pedFlag; // Variable for plot rescaling int frm_Count, col_Count, row_Count, dp_Count; //////////////////////////////////////////////// // Variables for DATA STORAGE and OUTPUT file // //////////////////////////////////////////////// const char *filepath; char filename[50]; Int_t header[50]; TFile* datafile; TTree* headertree; TTree* datatree; Double_t* img_data; Double_t* ped; Double_t* noi; UInt_t NPixels, nevent, tstamp, nspill; time_t date; clock_t timestamp; long tdate; // Data structures initialization void data_Setup(); // Communication setup void comm_Setup(); void set_FPGA(); // Chip specific settings void chip_TEAM_Set(); // GRETINA settings for TEAM1K full readout void team_Setup(); // Statistics arrays and event display initialization void stats_Reset(); void plots_Reset(); // Data acquisition/analysis void data_Reset(); // to be called to refit data structures depending on chip selection void data_Acquire(); void data_Invert(); void data_CDS(); void pedestal_Subtract(); void data_CMode(); void data_Display(); void data_Write(); // Delete data structures void data_Delete(); // Statistics (pedestals, noise) void stats_Update(); // Piles up data for subsequent pedestal and noise calculation void stats_Calculate(); // Perform the actual computation of pedestal and noise values void stats_Display(); // Show pedestal and noise map/distributions // Output file void file_Setup(); void file_Fill(); void file_Close(); // Special private memebers task_DAQ_Main(const task_DAQ_Main&) {} const task_DAQ_Main& operator=(const task_DAQ_Main&) {return *this;} public: ///////////////////////////////////////////////////////////////////////////// // GUI objects callback target functions (can be either public or private) // ///////////////////////////////////////////////////////////////////////////// void btn_run_Evn(const int arg); void btn_quit_Evn(const int arg); void btn_FPGA_Evn(const int arg); void btn_Comm_Evn(const int arg); void btn_TEAM_Evn(const int arg); void btn_reg_Evn(const int arg); // Special members task_DAQ_Main(); ~task_DAQ_Main(); // Slots void Event(const int arg) {std::cout << "main_lcl_event\n";}; static void glbEvent(const int arg) {std::cout << "main_glb_event\n";}; // Run! UInt_t run(); // Static handler (Callback can handle static target function as well) static void static_Evn(const int arg); }; // Overloading check #endif