GET library
GETActarEventReader.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETActarEventReader.hh
3  *
4  * Header file for the GETActarEventReader class.
5  */
6 //======================================================================
7 
8 #ifndef GET_ACTAR_EVENT_READER_HH
9 #define GET_ACTAR_EVENT_READER_HH
10 
11 #include "GEVSimulRun.hh"
12 #include "GETActarTpc.hh"
13 #include "GETActarTpcAnalyser.hh"
14 
15 ///! default initialization set-up file
16 #define GET_INIT_SETUP_DEFAULT_FILE "get_init_setup.dat"
17 
18 ///! default name for events validation condition
19 #define GET_VALID_TRACK_FILTER_NAME "F_ValidTrack"
20 
21 ///! default name for page displaying selected pads signal
22 #define GET_PAD_SIGNAL_PAGE "TestPadSignal"
23 
24 #define GET_BAD_DATA_BASELINE 1 ///< Bad event data identifier
25 #define GET_BAD_DATA_DELTA 2 ///< Bad event data identifier
26 #define GET_BAD_DATA_READ 4 ///< Bad event data identifier
27 
28 ///! Maximum number of selected events output files
29 #define GET_SELECT_MAX 16
30 
31 ///! Maximum number of filters to pause analysis
32 #define GET_FILTER_PAUSE 16
33 
34 ///! Maximum number of histogram families to reset/save at run start/stop
35 #define GET_RUN_FAMILY_MAX 16
36 
37 //======================================================================
38 /*! \page get_page_actar_reader GETActarEventReader analysis
39  *
40  * The GETActarEventReader class defines an effective run analysis class for
41  * the experimental data from ACTAR TPC.
42  *
43  * It is based on various classes:
44  * - the GEVRunBase class from the \b Event \b Analysis library, for the
45  * general run analysis scheme;
46  * - the GETActarTpc class from the \b GET library for the ACTAR / GET
47  * data processing.
48  *
49  * The class may be derived in a user class in order to include some
50  * specific analysis, otherwise a ready-to-use program is compiled
51  * for a direct use of the GETActarEventReader class: \b GETActarReader.
52  *
53  *
54  * \section get_actar_reader_class Analysis class
55  *
56  * The GETActarEventReader is based on:
57  * - the GEVRunBase class (from the <B>Event Analysis</B> library)
58  * that provides the basic scheme for events reading and
59  * processing, including a graphical user interface for interactive
60  * running and spectra analysis;
61  * - the GETActarTpc class (from GET library) that defines an object
62  * handling the data from the GET electronic;
63  *
64  *
65  *
66  * \section get_actar_reader_features Features of the analysis class
67  *
68  * <B>Definition of ACTAR TPC analysis structures</B>
69  *
70  *
71  * <B>Creation of selected events files</B>
72  *
73  *
74  * <B>Automatic save/reset of histogram family at end/start of run</B>
75  *
76  *
77  * <B>Channel signal verification</B>
78  *
79  *
80  * <B>User hook functions for derived classes</B>
81  *
82  * - user functions from GEVRunBase
83  * \code
84 
85  int UserEventDefine ( );
86  int UserRunStart ( );
87  int UserEvent ( );
88  int UserUpdate ( );
89  int UserRefresh ( );
90  int UserRunStop ( );
91  int UserReset ( );
92  int UserQuit ( );
93  int UserFit ( );
94 
95  \endcode
96  *
97  * - user functions from GETSystem
98  * \code
99 
100  int UserRawEvent ( );
101  int UserCorEvent ( );
102 
103  int UserAnyFrame ( MFMCommonFrame & frame );
104  int UserMergeFrame ( MFMMergeFrame & frame );
105  int UserCoBoFrame ( MFMCoboFrame & frame );
106  int UserEbyedatFrame ( MFMEbyedatFrame & frame );
107 
108  \endcode
109  *
110  *
111  * \section get_actar_reader_configuration Configuration of the analysis
112  *
113  * The reader/analysis class can be configured with a configuration
114  * file, that can combine configuration directives of the
115  * GETActarTpcAnalyser class and specific directives of the reader.
116  *
117  * The commands for the configuration file are detailed in the
118  * GETActarEventReader::ConfigCommand function.
119  *
120  * Some commands require that the GETSystem is defined (number of channels,
121  * sampling time and dimension).
122  *
123  * The configuration commands at defined and interpreted at different levels,
124  * in the following order:
125  * - in the current object (GETActarEventReader::ConfigCommand)
126  * - in the associated analyser (GETActarTpc::ConfigCommand)
127  * - in the analyser base class (GETSystem::ConfigCommand)
128  *
129  *
130  */
131 
132 //======================================================================
133 /*! \class GETActarEventReader
134  *
135  * See \ref get_page_actar_reader.
136  *
137  */
138 class GETActarEventReader : virtual public GETActarTpc, public GEVRunBase
139 {
140  //------------------------------------------------------------
141  /*! \object_doc */
143  //------------------------------------------------------------
144 
145  protected:
146  //============================================================
147  /** @name Additions to the GUI */
148  //@{
149  TGNumberEntryField * w_anal_stat_mfm; ///< MFM event number
150  //@}
151 
152  /** @name Variables related to GET system */
153  //@{
154  bool get_init; ///< GET initialization flag
155  u_int get_dim; ///< GET system channels size
156  double get_dt; ///< GET system time step
157  u_int get_nx; ///< ACTAR TPC pads number along X
158  u_int get_ny; ///< ACTAR TPC pads number along X
159 
160  double time_ref; ///< Run reference time (1st event) in sec.
161  double vdrift; ///< Signal drift velocity: if defined, use Z distance instead of time
162 
163  GETActarTpcAnalyser * get_analyser; ///< Pointer to the analyser object associated to GET system
164 
165  int current_run_num; ///< Run number of current file
166  int prev_run_num; ///< Run number of previous file
167  bool run_changed; ///< Indicate whether a new run has started (from run number)
168 
169  string get_init_default; ///< Default file for GET system initialization
170  string get_init_cfg; ///< File for GET system initialization
171  string get_run_cfg; ///< File for GET system run parameters
172  string get_lookup_table; ///< File for GET system look-up table
173  bool get_lt_rpad; ///< Whether the look-up table file contains the pad number
174  bool get_lt_invxy; ///< Whether the look-up table file has inverted X-Y pads
175  //@}
176 
177  //------------------------------------------------------------
178  /** @name Variables related to histograms created from GET data */
179  //@{
180  TH2 * h_full_raw; ///< Full raw data summary histogram
181  TH2 * h_full_out; ///< Full output corrected data summary histogram
182  TH1 * h_max_raw; ///< Raw data max amplitude summary histogram
183  TH1 * h_max_cor; ///< Corrected data max amplitude summary histogram
184  TH1 * h_time_raw; ///< Raw data time summary histogram
185  TH1 * h_time_cor; ///< Corrected data time summary histogram
186 
187  TH3 * h_exyt; ///< X-Y and T pads signal amplitude histogram
188 
189  TH2 * h_dxy; ///< X-Y histogram for pads with data
190  TH2 * h_hxy; ///< X-Y pads hits histogram
191  TH2 * h_txy; ///< X-Y pads signal time histogram
192  TH2 * h_exy; ///< X-Y pads signal amplitude histogram
193  TH2 * h_ext; ///< X-T pads signal amplitude histogram
194  TH2 * h_eyt; ///< X-T pads signal amplitude histogram
195 
196  TH1 * h_ex; ///< X signal projection histogram
197  TH1 * h_ey; ///< X signal projection histogram
198  TH1 * h_et; ///< X signal projection histogram
199 
200  int tdim_nt; ///< Number of bins of the time axis for the XY-T 3D histogram
201  double tdim_t0; ///< Lower value of the time axis for the XY-T 3D histogram
202  double tdim_t1; ///< Upper value of the time axis for the XY-T 3D histogram
203 
204  bool hok_full_raw; ///< Test for full raw event histogram creation
205  bool hok_full_out; ///< Test for full corrected event histogram creation
206 
207  bool hok_pads_xyt_e; ///< Test for XY+T pads amplitude histograms creation
208  bool hok_pads_xy_d; ///< Test for XY histograms for pads data creation
209  bool hok_pads_xy_h; ///< Test for XY pads hits histograms creation
210  bool hok_pads_xy_t; ///< Test for XY pads time histograms creation
211  bool hok_pads_xy_e; ///< Test for XY pads amplitude histograms creation
212  bool hok_pads_xt_e; ///< Test for XT pads amplitude histograms creation
213  bool hok_pads_yt_e; ///< Test for YT pads amplitude histograms creation
214  bool hok_pads_x_e; ///< Test for X projection histograms creation
215  bool hok_pads_y_e; ///< Test for Y projection histograms creation
216  bool hok_pads_t_e; ///< Test for T projection histograms creation
217 
218  bool hok_channels; ///< Indicates that some single channel histograms are defined
219  bool * hok_chan_out; ///< Create histograms associated to channels array parameters
220  bool hok_pads; ///< Indicates that some single pad histograms are defined
221  bool * hok_pad_out; ///< Create pad histograms associated to channels array parameters
222  bool hok_elec; ///< Indicates that some single electronics channels histograms are defined
223  bool * hok_elec_out; ///< Create electronics channels histograms associated to channels array parameters
224 
225  bool * aget_page; ///< AGet signal pages creation flags
226  //@}
227 
228  /** @name Variables related to parameters created from GET data */
229  //@{
230  bool pok_data_read; ///< Test for data read per channel array parameter creation
231  bool pok_max_raw; ///< Test for channel raw maximum summary array parameter creation
232  bool pok_max_cor; ///< Test for channel corrected maximum summary array parameter creation
233  bool pok_time_raw; ///< Test for channel raw time summary array parameter creation
234  bool pok_time_cor; ///< Test for channel corrected time summary array parameter creation
235  bool pok_channels; ///< Indicates that some single channel parameters are defined
236  bool * pok_chan_out; ///< Test for single channels array parameters creation (output signal)
237  //bool * pok_chan_rec; ///< Test for single channels array parameters creation (reconstructed signal)
238 
239  int ip_evtnum; ///< Parameter index for event number
240  int ip_evtacq; ///< Parameter index for event number in GET acquisition
241  int ip_evttime; ///< Parameter index for event time (sec.) in GET acquisition
242  int ip_max_raw; ///< Parameter index for array of maximum values for raw signals
243  int ip_max_cor; ///< Parameter index for array of maximum values for corrected signals
244  int ip_time_raw; ///< Parameter index for array of time values for raw signals
245  int ip_time_cor; ///< Parameter index for array of time values for corrected signals
246 
247  int ip_eamp_all; ///< Parameter index for GET signal sum of channels maximum (all channels)
248  int ip_eamp_thr; ///< Parameter index for GET signal sum of channels maximum (channels above threshold)
249  int ip_eint_all; ///< Parameter index for GET signal sum of channels integral (all channels)
250  int ip_eint_thr; ///< Parameter index for GET signal sum of channels integral (channels above threshold)
251  int ip_mmax_sum; ///< Parameter index for GET signal sum from multiple maxima analysis
252 
253  int ip_max_signal; ///< Parameter index for maximum signal value
254  int ip_max_channel; ///< Parameter index for channel number maximum signal
255 
256  int ip_read_mult; ///< Readout channels multiplicity parameter
257  int ip_pads_mult; ///< Multiplicity of pads above (soft) threshold
258  int ip_saturation_count; ///< parameter for number of saturated channels
259  int ip_noise; ///< Parameter for array of channels noise
260  int ip_data_read; ///< Readout data number per channel parameter
261  int ip_data_chk; ///< Parameter for data checks
262  int ip_base_chk; ///< Parameter for baseline fluctuation check
263  int ip_resol_amp; ///< Parameter for amplitude resolution analysis
264 
265  int ip_xmin; ///< Parameter index for pads signal boundaries
266  int ip_xmax; ///< Parameter index for pads signal boundaries
267  int ip_xlen; ///< Parameter index for pads signal boundaries
268  int ip_ymin; ///< Parameter index for pads signal boundaries
269  int ip_ymax; ///< Parameter index for pads signal boundaries
270  int ip_ylen; ///< Parameter index for pads signal boundaries
271  int ip_tmin; ///< Parameter index for pads signal boundaries
272  int ip_tmax; ///< Parameter index for pads signal boundaries
273  int ip_tlen; ///< Parameter index for pads signal boundaries
274  int * ip_chan_out; ///< Parameter index for single channels output signal
275  int * ip_chan_rec; ///< Parameter index for single channels reconstructed signal
276  int * ip_chan_fit; ///< Parameter index for single channels fitted signal
277 
278  // analysis parameters
279  int read_mult; ///< Readout channels multiplicity (with FPN)
280  int pads_mult; ///< Pads multiplicity
281 
282  int bad_events; ///< Number of bad events in the run
283 
284  double ampl_all_c0; ///< Calibration parameter for sum of channels maximum
285  double ampl_all_c1; ///< Calibration parameter for sum of channels maximum
286  double ampl_thr_c0; ///< Calibration parameter for sum of channels (above threshold) maximum
287  double ampl_thr_c1; ///< Calibration parameter for sum of channels (above threshold) maximum
288 
289  double eint_all_c0; ///< Calibration parameter for sum of channels integral
290  double eint_all_c1; ///< Calibration parameter for sum of channels integral
291  double eint_thr_c0; ///< Calibration parameter for sum of channels (above threshold) integral
292  double eint_thr_c1; ///< Calibration parameter for sum of channels (above threshold) integral
293  //@}
294 
295  //------------------------------------------------------------
296  /** @name Variables related to preselected analysis */
297  //@{
298  string pad_signal_page; ///< Page name for automatic display of pads signal
299 
300  GStringList default_analysis; ///< Analysis loaded at initialization
301 
302  //@}
303 
304  //------------------------------------------------------------
305  /** @name Selected events output file */
306  //@{
307 
308  string selTxtColor; ///< Highlight for selected events messages
309  string selTxtNorm; ///< End of highlight for selected events messages
310 
311  // the event selection is performed at "update" phase of the analysis
312  u_int selEventNum; ///< Number of selected events outputs
313  u_int selEventCount [GET_SELECT_MAX]; ///< Counts of selected events
314  string selEventDir [GET_SELECT_MAX]; ///< Names of the directories for selected events output
315  string selEventFname; ///< Base file name (set at start of new run)
316  FILE * selEventFilePtr[GET_SELECT_MAX]; ///< File pointers for selected events
317  int selEventFileLun[GET_SELECT_MAX]; ///< Logical units of file for selected events
318  u_int selEventFileSub[GET_SELECT_MAX]; ///< Selected events sub-file number
319  u_int selEventFileCnt[GET_SELECT_MAX]; ///< Number of events in the sub-file
320  u_int selEventFileMax[GET_SELECT_MAX]; ///< Max. number of events in the sub-file
321  string selFilterName [GET_SELECT_MAX]; ///< Names of the filters for event selection
322  Filter * selFilterPtr [GET_SELECT_MAX]; ///< Pointer to the filters for event selection
323 
324  //string lastRunFileName; ///< To check if a new file was open for the same run
325 
326  u_int pauseFilterNum; ///< Number of filters that cause the analysis pause
327  string pauseFilterName [GET_FILTER_PAUSE]; ///< Names of the filters
328  Filter * pauseFilterPtr [GET_FILTER_PAUSE]; ///< Pointer to the filters
329  u_int pauseFilterCount[GET_FILTER_PAUSE]; ///< Names of the filters
330  bool pauseFilterStop [GET_FILTER_PAUSE]; ///< The filter stops event reading (else, only update)
331 
332  //------------------------------------------------------------
333  /** @name Automatic reset/save histogram families at run start/stop */
334  //@{
335  u_int runFamilyNum; ///< Number of run families
336  string runFamilyName[GET_RUN_FAMILY_MAX]; ///< Names of run families
337  GString runFamilyFile[GET_RUN_FAMILY_MAX]; ///< File names of run families (empty for no save)
338  //@}
339 
340  public:
341 
342  //============================================================
343  /** @name Constructor and destructor */
344  //@{
345  GETActarEventReader ( bool construct = true );
346  virtual ~GETActarEventReader ( );
347  //@}
348 
349  //------------------------------------------------------------
350  /** @name Read of event files functions */
351  //@{
352  virtual int Open ( );
353  virtual bool IsOpen ( );
354  virtual int Close ( );
355  virtual int RunInit ( );
356  virtual int RunStart ( );
357  virtual int RunStop ( );
358 
359  virtual int FileOpen ( );
360  virtual void FileClose ( );
361 
362  // overloaded to adapt RunStop call
363  virtual void ResetFileList ( );
364 
365  virtual void Reset ( );
366  virtual void Quit ( );
367 
368  virtual bool RunChanged ( ) const; // inline
369 
370  virtual int CreateEvent ( );
371  virtual int ReadEvent ( );
372  //@}
373 
374  //------------------------------------------------------------
375  /** @name Graphical user interface modifications */
376  //@{
377  // function redefined from GEVRunBase
378  virtual void Construct ( );
379  virtual void SetColorMode ( );
380  virtual void UpdateDisplay ( );
381 
382  // Click in a page
383  virtual int HistoEventSlot ( Int_t event,
384  const GEVPage * page_ptr,
385  const GEVPad * pad_ptr,
386  const TH1 * histo_ptr,
387  const Double_t x, const Double_t y );
388 
389  virtual int HistoClickedSlot ( const GEVPage * page_ptr,
390  const GEVPad * pad_ptr,
391  const TH1 * histo_ptr,
392  const Double_t x, const Double_t y );
393 
394  virtual void PadPlaneButton1Click ( const TH2 * hpad, int ix, int iy );
395  virtual void PadPlaneButton1DoubleClick ( const TH2 * hpad, int ix, int iy );
396  virtual void PadPlaneButton2Click ( const TH2 * hpad, int ix, int iy );
397  virtual void PadPlaneButton2DoubleClick ( const TH2 * hpad, int ix, int iy );
398 
399  //@}
400 
401  //------------------------------------------------------------
402  /** @name Analysis configuration function */
403  //@{
404  virtual int ProcessCmdLine ( int & argc, char ** argv, bool supp = true );
405  virtual void ProcessLineHelp ( ) const;
406 
407  virtual void SetDefaultAnalysis ( const string & ana );
408  virtual void SetLookupTable ( const string & ltfile );
409 
410  virtual void ReadInitConfig ( );
411  virtual void ReadRunConfig ( );
412  virtual int ReadConfigFile ( const string & cfg );
413  virtual int ReadConfigFile ( FILE * fp );
414  virtual bool ConfigCommand ( const GString & code, const GString & args = "", FILE * fptr = NULL );
415  virtual bool ConfigCommandLine ( const string & cmd, FILE * fptr = NULL );
416 
417  virtual void GETInit ( );
418  virtual GETActarTpcAnalyser * DefineAnalyser ( );
419 
420  virtual void SetGETInitConfigFile ( const string & cfg );
421  virtual void SetGETRunConfigFile ( const string & cfg );
422  //@}
423 
424  //------------------------------------------------------------
425  /** @name Analysis definition */
426  //@{
427  string GetCoBoId ( int i ) const; // inline
428  string GetAsAdId ( int i ) const; // inline
429  string GetAGetId ( int i ) const; // inline
430  string GetChannelId ( int i ) const; // inline
431  string GetIndexId ( int i ) const; // inline
432  string GetPadId ( int ix, int iy ) const; // inline
433  string GetElecId ( int i ) const; // inline
434  string GetElecId ( int co, int as, int ag, int ch ) const; // inline
435 
436  // preselected channels parameters & histograms
437  virtual void PresetChannelParam ( const string & def, bool hdef = false );
438  virtual void PresetChannelParam ( int cobo, int asad,
439  int aget, int chan,
440  bool hdef = false );
441  virtual void PresetChannelParam ( int ich0 = 0, int ich1 = -1,
442  bool hdef = false );
443  virtual void PresetPadParam ( const string & def, bool hdef = false );
444  virtual void PresetPadParam ( int ix0, int ix1, int iy0, int iy1, bool hdef = false );
445 
446  virtual int DefinePadSpectrum ( int ix, int iy, bool fill = false );
447  virtual int DefineElecSpectrum ( u_int cobo, u_int asad, u_int aget, u_int chan, bool fill = false );
448  virtual int DefineChannelSpectrum ( int ich, bool fill = false );
449  virtual int DefineChannelSpectrum ( int ich, const string & name, bool fill = false );
450 
451  virtual void PresetAgetPage ( const string & def );
452  virtual void PresetAgetPage ( int cobo, int asad, int aget );
453 
454  // function defining the preselected spectra and analysis
455  virtual void PresetAnalysis ( );
456  virtual void PresetSystemAnalysis ( );
457  virtual void PresetLoadedAnalysis ( );
458 
459  // specific analysis start / stop reimplemented from RunBase
460  virtual void AnalysisStart ( );
461  virtual void AnalysisStop ( );
462 
463  virtual void AnalysisEvent ( );
464 
465  // incrementation function, reimplemented from GEVRunBase for
466  // writting of selected events after user event analysis
467  virtual void IncrementSpectra ( ) const;
468  //@}
469 
470  //------------------------------------------------------------
471  /** @name Selected events output files */
472  //@{
473  virtual bool SetSelectedEventsFilter ( const string & filter, const string & dir, u_int nmax = 0 );
474  virtual int OpenSelectedEventsFile ( u_int nf );
475  virtual int CloseSelectedEventsFile ( u_int nf );
476  virtual int CloseSelectedEventsFiles ( );
477  virtual int WriteSelectedEvent ( );
478  //@}
479 
480  //------------------------------------------------------------
481  /** @name Standard user hooks function */
482  //@{
483 
484  // Initialization function (user parameters definition,...)
485  virtual int UserEventDefine ( );
486 
487  // Start of run processing initialization
488  virtual int UserRunStart ( );
489 
490  // New file open, with or without no run change
491  virtual int UserNewFile ( );
492 
493  // Event processing
494  virtual int UserEvent ( );
495 
496  // Function called after spectra update
497  virtual int UserUpdate ( );
498 
499  // Fonction appelée après mise à jour automatique de l'affichage (spécifique GUI)
500  virtual int UserRefresh ( );
501 
502  // End of run processing
503  virtual int UserRunStop ( );
504 
505  // Function called at analysis reset (specific GUI)
506  virtual int UserReset ( );
507 
508  // Function called when quitting interface (specific GUI)
509  virtual int UserQuit ( );
510 
511  // Function called when a fit is accepted (specific GUI)
512  virtual int UserFit ( );
513 
514  //@}
515 
516  //----------------------------------------------------------
517  /** @name User hooks function from GETActarTpc class */
518  //@{
519 
520  // Function called after the raw data analysis of the GET system
521  virtual int UserRawEvent ( );
522 
523  // Function called after the corrected / reconstructed data analysis of the GET system
524  virtual int UserCorEvent ( );
525 
526  //@}
527 
528  //------------------------------------------------------------
529  /** @name ROOT related function */
530  //@{
531  // For ROOT encapsulation
532  ClassDef(GETActarEventReader,0);
533  //@}
534 };
535 
536 //----------------------------------------------------------------------
537 
538 ///! Defined to avoid recursive declaration for ROOT dictionary
539 #ifndef GET_ACTAR_EVENT_READER_LINKDEF_H
540  #define GET_ACTAR_EVENT_READER_LINKDEF_H
541  #if defined (__MAKECINT__) || defined (__ROOTCLING__)
542  #pragma link C++ class GETActarEventReader;
543  #endif
544 #endif
545 
546 //======================================================================
547 // Inline function
548 
549 /*! This function returns true, at run start, if the run number has changed.
550  * When a new file is open from the same run, it remains to false.
551  */
552 inline bool GETActarEventReader::RunChanged ( ) const
553 { return ( run_changed ); }
554 
555 //----------------------------------------------------------------------
556 
557 /*! Function defining a standardized short identifier for a CoBo module.
558  * \param i CoBo index
559  */
560 inline string GETActarEventReader::GetCoBoId ( int i ) const
561  { char str[16]; sprintf ( str, "C%02d", i ); return ( string(str) ); }
562 
563 /*! Function defining a standardized short identifier for an AsAd board.
564  * \param i Asad index (0-3)
565  */
566 inline string GETActarEventReader::GetAsAdId ( int i ) const
567  { char str[16]; sprintf ( str, "A%01d", i ); return ( string(str) ); }
568 
569 /*! Function defining a standardized short identifier for an AGet chip.
570  * \param i AGet index (0-3)
571  */
572 inline string GETActarEventReader::GetAGetId ( int i ) const
573  { char str[16]; sprintf ( str, "G%01d", i ); return ( string(str) ); }
574 
575 /*! Function defining a standardized short identifier for an AGet channel.
576  * \param i channel index (0-67)
577  */
578 inline string GETActarEventReader::GetChannelId ( int i ) const
579  { char str[16]; sprintf ( str, "Ch%02d", i ); return ( string(str) ); }
580 
581 /*! Function defining a standardized short identifier for a channel of the
582  * whole GET system.
583  * \param i channel index
584  */
585 inline string GETActarEventReader::GetIndexId ( int i ) const
586  { char str[16]; sprintf ( str, "%05d", i ); return ( string(str) ); }
587 
588 /*! Function defining a standardized short identifier for a pad.
589  * \param ix pad index along X (0-...)
590  * \param iy pad index along Y (0-...)
591  */
592 inline string GETActarEventReader::GetPadId ( int ix, int iy ) const
593  { char str[16]; sprintf ( str, "x%03d_y%03d", ix, iy ); return ( string(str) ); }
594 
595 
596 /*! Function defining a standardized short identifier for an electronics channel.
597  * \param i global channel index
598  */
599 inline string GETActarEventReader::GetElecId ( int i ) const
600  { int cobo = LookupTable().GetCoBo(i);
601  int asad = LookupTable().GetAsAd(i);
602  int aget = LookupTable().GetAGet(i);
603  int chan = LookupTable().GetChannel(i);
604  return ( GetElecId(cobo,asad,aget,chan) ); }
605 
606 /*! Function defining a standardized short identifier for an electronics channel.
607  * \param co CoBo index
608  * \param as AsAd index in CoBo (0-3)
609  * \param ag AGET index in AsAd (0-3)
610  * \param ch Channel index in AGET (0-67)
611  */
612 inline string GETActarEventReader::GetElecId ( int co, int as, int ag, int ch ) const
613  { return ( GetCoBoId(co)
614  + "_" + GetAsAdId(as)
615  + "_" + GetAGetId(ag)
616  + "_" + GetChannelId(ch) ); }
617 
618 //----------------------------------------------------------------------
619 
620 
621 //======================================================================
622 
623 #endif
int ip_evtacq
Parameter index for event number in GET acquisition.
Definition: GETActarEventReader.hh:240
u_int runFamilyNum
Number of run families.
Definition: GETActarEventReader.hh:335
string GetIndexId(int i) const
Definition: GETActarEventReader.hh:585
virtual int DefineElecSpectrum(u_int cobo, u_int asad, u_int aget, u_int chan, bool fill=false)
Definition: GETActarEventReader.cpp:2556
virtual void AnalysisStart()
Definition: GETActarEventReader.cpp:3127
int ip_ylen
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:270
int ip_evtnum
Parameter index for event number.
Definition: GETActarEventReader.hh:239
string selTxtNorm
End of highlight for selected events messages.
Definition: GETActarEventReader.hh:309
int read_mult
Readout channels multiplicity (with FPN)
Definition: GETActarEventReader.hh:279
virtual int HistoClickedSlot(const GEVPage *page_ptr, const GEVPad *pad_ptr, const TH1 *histo_ptr, const Double_t x, const Double_t y)
Definition: GETActarEventReader.cpp:832
string pad_signal_page
Page name for automatic display of pads signal.
Definition: GETActarEventReader.hh:298
string GetChannelId(int i) const
Definition: GETActarEventReader.hh:578
virtual int GetAGet(u_int nch) const
Definition: GETLookupTable.icc:43
virtual void AnalysisStop()
Definition: GETActarEventReader.cpp:3138
virtual void PadPlaneButton2DoubleClick(const TH2 *hpad, int ix, int iy)
Definition: GETActarEventReader.cpp:1066
double eint_all_c0
Calibration parameter for sum of channels integral.
Definition: GETActarEventReader.hh:289
string pauseFilterName[16]
Names of the filters.
Definition: GETActarEventReader.hh:327
GETActarTpcAnalyser * get_analyser
Pointer to the analyser object associated to GET system.
Definition: GETActarEventReader.hh:163
virtual void UpdateDisplay()
Definition: GETActarEventReader.cpp:227
double tdim_t1
Upper value of the time axis for the XY-T 3D histogram.
Definition: GETActarEventReader.hh:202
TH1 * h_et
X signal projection histogram.
Definition: GETActarEventReader.hh:198
bool hok_pads_xy_h
Test for XY pads hits histograms creation.
Definition: GETActarEventReader.hh:209
bool hok_pads_xt_e
Test for XT pads amplitude histograms creation.
Definition: GETActarEventReader.hh:212
int ip_tmax
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:272
FILE * selEventFilePtr[16]
File pointers for selected events.
Definition: GETActarEventReader.hh:316
double eint_thr_c1
Calibration parameter for sum of channels (above threshold) integral.
Definition: GETActarEventReader.hh:292
u_int get_nx
ACTAR TPC pads number along X.
Definition: GETActarEventReader.hh:157
GETActarEventReader(bool construct=true)
Definition: GETActarEventReader.cpp:25
virtual int CloseSelectedEventsFiles()
Definition: GETActarEventReader.cpp:3554
const GETLookupTable & LookupTable() const
Definition: GETSystem.icc:182
virtual void PadPlaneButton1Click(const TH2 *hpad, int ix, int iy)
Definition: GETActarEventReader.cpp:930
int ip_ymax
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:269
int ip_tmin
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:271
virtual int UserEvent()
Definition: GETActarEventReader.cpp:3734
virtual bool SetSelectedEventsFilter(const string &filter, const string &dir, u_int nmax=0)
Definition: GETActarEventReader.cpp:3428
virtual int UserFit()
Definition: GETActarEventReader.cpp:3806
double get_dt
GET system time step.
Definition: GETActarEventReader.hh:156
virtual void GETInit()
Definition: GETActarEventReader.cpp:2134
double ampl_thr_c1
Calibration parameter for sum of channels (above threshold) maximum.
Definition: GETActarEventReader.hh:287
int ip_xlen
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:267
int ip_ymin
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:268
GString runFamilyFile[16]
File names of run families (empty for no save)
Definition: GETActarEventReader.hh:337
virtual bool ConfigCommand(const GString &code, const GString &args="", FILE *fptr=NULL)
Definition: GETActarEventReader.cpp:1665
virtual bool IsOpen()
Definition: GETActarEventReader.cpp:275
int ip_saturation_count
parameter for number of saturated channels
Definition: GETActarEventReader.hh:258
double eint_thr_c0
Calibration parameter for sum of channels (above threshold) integral.
Definition: GETActarEventReader.hh:291
bool * aget_page
AGet signal pages creation flags.
Definition: GETActarEventReader.hh:225
double ampl_all_c0
Calibration parameter for sum of channels maximum.
Definition: GETActarEventReader.hh:284
bool hok_full_out
Test for full corrected event histogram creation.
Definition: GETActarEventReader.hh:205
bool hok_pads_t_e
Test for T projection histograms creation.
Definition: GETActarEventReader.hh:216
virtual void Quit()
Definition: GETActarEventReader.cpp:550
virtual void ReadRunConfig()
Definition: GETActarEventReader.cpp:1437
bool hok_pads_yt_e
Test for YT pads amplitude histograms creation.
Definition: GETActarEventReader.hh:213
int current_run_num
Run number of current file.
Definition: GETActarEventReader.hh:165
virtual int ReadConfigFile(const string &cfg)
Definition: GETActarEventReader.cpp:1485
virtual void PresetAgetPage(const string &def)
Definition: GETActarEventReader.cpp:2440
bool hok_pads_xyt_e
Test for XY+T pads amplitude histograms creation.
Definition: GETActarEventReader.hh:207
string GetCoBoId(int i) const
Definition: GETActarEventReader.hh:560
virtual void PresetPadParam(const string &def, bool hdef=false)
Definition: GETActarEventReader.cpp:2386
string get_init_default
Default file for GET system initialization.
Definition: GETActarEventReader.hh:169
double eint_all_c1
Calibration parameter for sum of channels integral.
Definition: GETActarEventReader.hh:290
GObject(GETActarEventReader)
bool hok_pads_xy_t
Test for XY pads time histograms creation.
Definition: GETActarEventReader.hh:210
bool get_init
GET initialization flag.
Definition: GETActarEventReader.hh:154
TH1 * h_ex
X signal projection histogram.
Definition: GETActarEventReader.hh:196
string GetAGetId(int i) const
Definition: GETActarEventReader.hh:572
int ip_xmax
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:266
bool hok_pads_y_e
Test for Y projection histograms creation.
Definition: GETActarEventReader.hh:215
TH2 * h_exy
X-Y pads signal amplitude histogram.
Definition: GETActarEventReader.hh:192
int ip_evttime
Parameter index for event time (sec.) in GET acquisition.
Definition: GETActarEventReader.hh:241
string GetAsAdId(int i) const
Definition: GETActarEventReader.hh:566
int ip_pads_mult
Multiplicity of pads above (soft) threshold.
Definition: GETActarEventReader.hh:257
virtual int UserRunStart()
Definition: GETActarEventReader.cpp:3716
virtual GETActarTpcAnalyser * DefineAnalyser()
Definition: GETActarEventReader.cpp:2186
TH1 * h_time_raw
Raw data time summary histogram.
Definition: GETActarEventReader.hh:184
int tdim_nt
Number of bins of the time axis for the XY-T 3D histogram.
Definition: GETActarEventReader.hh:200
string selTxtColor
Highlight for selected events messages.
Definition: GETActarEventReader.hh:308
int ip_eint_thr
Parameter index for GET signal sum of channels integral (channels above threshold) ...
Definition: GETActarEventReader.hh:250
#define GET_SELECT_MAX
! Maximum number of selected events output files
Definition: GETActarEventReader.hh:29
virtual void Construct()
Definition: GETActarEventReader.cpp:182
TH2 * h_dxy
X-Y histogram for pads with data.
Definition: GETActarEventReader.hh:189
u_int pauseFilterCount[16]
Names of the filters.
Definition: GETActarEventReader.hh:329
bool pok_time_raw
Test for channel raw time summary array parameter creation.
Definition: GETActarEventReader.hh:233
virtual int UserQuit()
Definition: GETActarEventReader.cpp:3787
double tdim_t0
Lower value of the time axis for the XY-T 3D histogram.
Definition: GETActarEventReader.hh:201
u_int selEventFileMax[16]
Max. number of events in the sub-file.
Definition: GETActarEventReader.hh:320
double time_ref
Run reference time (1st event) in sec.
Definition: GETActarEventReader.hh:160
int pads_mult
Pads multiplicity.
Definition: GETActarEventReader.hh:280
int ip_data_read
Readout data number per channel parameter.
Definition: GETActarEventReader.hh:260
bool hok_pads_xy_d
Test for XY histograms for pads data creation.
Definition: GETActarEventReader.hh:208
virtual int GetCoBo(u_int nch) const
Definition: GETLookupTable.icc:31
#define GET_FILTER_PAUSE
! Maximum number of filters to pause analysis
Definition: GETActarEventReader.hh:32
virtual int Open()
Definition: GETActarEventReader.cpp:243
bool hok_channels
Indicates that some single channel histograms are defined.
Definition: GETActarEventReader.hh:218
bool pok_max_raw
Test for channel raw maximum summary array parameter creation.
Definition: GETActarEventReader.hh:231
TH3 * h_exyt
X-Y and T pads signal amplitude histogram.
Definition: GETActarEventReader.hh:187
virtual int DefinePadSpectrum(int ix, int iy, bool fill=false)
Definition: GETActarEventReader.cpp:2527
int ip_resol_amp
Parameter for amplitude resolution analysis.
Definition: GETActarEventReader.hh:263
virtual void SetLookupTable(const string &ltfile)
Definition: GETActarEventReader.cpp:1380
int bad_events
Number of bad events in the run.
Definition: GETActarEventReader.hh:282
bool get_lt_rpad
Whether the look-up table file contains the pad number.
Definition: GETActarEventReader.hh:173
virtual int UserEventDefine()
Definition: GETActarEventReader.cpp:3704
GETProcessLink filter
Signal processing filter.
Definition: GETObject.hh:53
int ip_base_chk
Parameter for baseline fluctuation check.
Definition: GETActarEventReader.hh:262
TH1 * h_ey
X signal projection histogram.
Definition: GETActarEventReader.hh:197
bool * hok_chan_out
Create histograms associated to channels array parameters.
Definition: GETActarEventReader.hh:219
TH2 * h_hxy
X-Y pads hits histogram.
Definition: GETActarEventReader.hh:190
string GetPadId(int ix, int iy) const
Definition: GETActarEventReader.hh:592
int ip_time_cor
Parameter index for array of time values for corrected signals.
Definition: GETActarEventReader.hh:245
bool pok_max_cor
Test for channel corrected maximum summary array parameter creation.
Definition: GETActarEventReader.hh:232
TH2 * h_full_out
Full output corrected data summary histogram.
Definition: GETActarEventReader.hh:181
int ip_tlen
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:273
int ip_eamp_all
Parameter index for GET signal sum of channels maximum (all channels)
Definition: GETActarEventReader.hh:247
int * ip_chan_out
Parameter index for single channels output signal.
Definition: GETActarEventReader.hh:274
string get_init_cfg
File for GET system initialization.
Definition: GETActarEventReader.hh:170
bool run_changed
Indicate whether a new run has started (from run number)
Definition: GETActarEventReader.hh:167
GETCoBo * cobo
Array of CoBo modules.
Definition: GETSystem.hh:162
TH2 * h_full_raw
Full raw data summary histogram.
Definition: GETActarEventReader.hh:180
virtual int Close()
Definition: GETActarEventReader.cpp:283
int ip_xmin
Parameter index for pads signal boundaries.
Definition: GETActarEventReader.hh:265
virtual int UserCorEvent()
Definition: GETActarEventReader.cpp:3830
Definition: GETActarTpcAnalyser.hh:66
virtual void SetGETRunConfigFile(const string &cfg)
Definition: GETActarEventReader.cpp:2216
bool hok_elec
Indicates that some single electronics channels histograms are defined.
Definition: GETActarEventReader.hh:222
string get_run_cfg
File for GET system run parameters.
Definition: GETActarEventReader.hh:171
virtual void Reset()
Definition: GETActarEventReader.cpp:526
string selFilterName[16]
Names of the filters for event selection.
Definition: GETActarEventReader.hh:321
string GetElecId(int i) const
Definition: GETActarEventReader.hh:599
Filter * pauseFilterPtr[16]
Pointer to the filters.
Definition: GETActarEventReader.hh:328
bool get_lt_invxy
Whether the look-up table file has inverted X-Y pads.
Definition: GETActarEventReader.hh:174
int ip_time_raw
Parameter index for array of time values for raw signals.
Definition: GETActarEventReader.hh:244
TH1 * h_time_cor
Corrected data time summary histogram.
Definition: GETActarEventReader.hh:185
virtual void PresetAnalysis()
Definition: GETActarEventReader.cpp:2792
bool * hok_elec_out
Create electronics channels histograms associated to channels array parameters.
Definition: GETActarEventReader.hh:223
int ip_max_channel
Parameter index for channel number maximum signal.
Definition: GETActarEventReader.hh:254
double ampl_all_c1
Calibration parameter for sum of channels maximum.
Definition: GETActarEventReader.hh:285
virtual void SetColorMode()
Definition: GETActarEventReader.cpp:213
virtual void SetDefaultAnalysis(const string &ana)
Definition: GETActarEventReader.cpp:1371
int * ip_chan_rec
Parameter index for single channels reconstructed signal.
Definition: GETActarEventReader.hh:275
GStringList default_analysis
Analysis loaded at initialization.
Definition: GETActarEventReader.hh:300
bool hok_pads_xy_e
Test for XY pads amplitude histograms creation.
Definition: GETActarEventReader.hh:211
virtual void PadPlaneButton2Click(const TH2 *hpad, int ix, int iy)
Definition: GETActarEventReader.cpp:1056
bool pok_time_cor
Test for channel corrected time summary array parameter creation.
Definition: GETActarEventReader.hh:234
bool pok_channels
Indicates that some single channel parameters are defined.
Definition: GETActarEventReader.hh:235
virtual int OpenSelectedEventsFile(u_int nf)
Definition: GETActarEventReader.cpp:3471
virtual int UserRunStop()
Definition: GETActarEventReader.cpp:3762
virtual void AnalysisEvent()
Definition: GETActarEventReader.cpp:3152
u_int get_ny
ACTAR TPC pads number along X.
Definition: GETActarEventReader.hh:158
bool hok_pads_x_e
Test for X projection histograms creation.
Definition: GETActarEventReader.hh:214
int ip_max_cor
Parameter index for array of maximum values for corrected signals.
Definition: GETActarEventReader.hh:243
string selEventFname
Base file name (set at start of new run)
Definition: GETActarEventReader.hh:315
int ip_max_signal
Parameter index for maximum signal value.
Definition: GETActarEventReader.hh:253
u_int get_dim
GET system channels size.
Definition: GETActarEventReader.hh:155
virtual void IncrementSpectra() const
Definition: GETActarEventReader.cpp:3372
int prev_run_num
Run number of previous file.
Definition: GETActarEventReader.hh:166
virtual int UserRawEvent()
Definition: GETActarEventReader.cpp:3820
virtual bool ConfigCommandLine(const string &cmd, FILE *fptr=NULL)
Definition: GETActarEventReader.cpp:1553
string get_lookup_table
File for GET system look-up table.
Definition: GETActarEventReader.hh:172
virtual void SetGETInitConfigFile(const string &cfg)
Definition: GETActarEventReader.cpp:2201
virtual int ProcessCmdLine(int &argc, char **argv, bool supp=true)
Definition: GETActarEventReader.cpp:1092
virtual void PresetSystemAnalysis()
Definition: GETActarEventReader.cpp:2804
TH1 * h_max_raw
Raw data max amplitude summary histogram.
Definition: GETActarEventReader.hh:182
virtual int DefineChannelSpectrum(int ich, bool fill=false)
Definition: GETActarEventReader.cpp:2599
virtual int HistoEventSlot(Int_t event, const GEVPage *page_ptr, const GEVPad *pad_ptr, const TH1 *histo_ptr, const Double_t x, const Double_t y)
Definition: GETActarEventReader.cpp:737
virtual int UserRefresh()
Definition: GETActarEventReader.cpp:3754
string runFamilyName[16]
Names of run families.
Definition: GETActarEventReader.hh:336
double vdrift
Signal drift velocity: if defined, use Z distance instead of time.
Definition: GETActarEventReader.hh:161
virtual int UserUpdate()
Definition: GETActarEventReader.cpp:3744
virtual int UserReset()
Definition: GETActarEventReader.cpp:3779
virtual void PresetChannelParam(const string &def, bool hdef=false)
Definition: GETActarEventReader.cpp:2231
bool hok_full_raw
Test for full raw event histogram creation.
Definition: GETActarEventReader.hh:204
virtual int CreateEvent()
Definition: GETActarEventReader.cpp:569
virtual int RunStart()
Definition: GETActarEventReader.cpp:355
int ip_eint_all
Parameter index for GET signal sum of channels integral (all channels)
Definition: GETActarEventReader.hh:249
TH2 * h_txy
X-Y pads signal time histogram.
Definition: GETActarEventReader.hh:191
TH1 * h_max_cor
Corrected data max amplitude summary histogram.
Definition: GETActarEventReader.hh:183
int ip_eamp_thr
Parameter index for GET signal sum of channels maximum (channels above threshold) ...
Definition: GETActarEventReader.hh:248
int ip_data_chk
Parameter for data checks.
Definition: GETActarEventReader.hh:261
bool hok_pads
Indicates that some single pad histograms are defined.
Definition: GETActarEventReader.hh:220
Definition: GETActarTpc.hh:27
int ip_max_raw
Parameter index for array of maximum values for raw signals.
Definition: GETActarEventReader.hh:242
virtual void ProcessLineHelp() const
Definition: GETActarEventReader.cpp:1302
u_int selEventCount[16]
Counts of selected events.
Definition: GETActarEventReader.hh:313
double ampl_thr_c0
Calibration parameter for sum of channels (above threshold) maximum.
Definition: GETActarEventReader.hh:286
virtual void ReadInitConfig()
Definition: GETActarEventReader.cpp:1392
Definition: GETActarEventReader.hh:138
int selEventFileLun[16]
Logical units of file for selected events.
Definition: GETActarEventReader.hh:317
virtual ~GETActarEventReader()
Definition: GETActarEventReader.cpp:163
virtual int ReadEvent()
Definition: GETActarEventReader.cpp:669
bool pok_data_read
Test for data read per channel array parameter creation.
Definition: GETActarEventReader.hh:230
virtual void ResetFileList()
Definition: GETActarEventReader.cpp:513
virtual int UserNewFile()
Definition: GETActarEventReader.cpp:3726
u_int selEventNum
Number of selected events outputs.
Definition: GETActarEventReader.hh:312
TGNumberEntryField * w_anal_stat_mfm
MFM event number.
Definition: GETActarEventReader.hh:149
virtual int GetChannel(u_int nch) const
Definition: GETLookupTable.icc:49
virtual int RunStop()
Definition: GETActarEventReader.cpp:415
u_int pauseFilterNum
Number of filters that cause the analysis pause.
Definition: GETActarEventReader.hh:326
virtual int GetAsAd(u_int nch) const
Definition: GETLookupTable.icc:37
bool * pok_chan_out
Test for single channels array parameters creation (output signal)
Definition: GETActarEventReader.hh:236
bool pauseFilterStop[16]
The filter stops event reading (else, only update)
Definition: GETActarEventReader.hh:330
virtual void PadPlaneButton1DoubleClick(const TH2 *hpad, int ix, int iy)
Definition: GETActarEventReader.cpp:944
u_int selEventFileCnt[16]
Number of events in the sub-file.
Definition: GETActarEventReader.hh:319
bool * hok_pad_out
Create pad histograms associated to channels array parameters.
Definition: GETActarEventReader.hh:221
string selEventDir[16]
Names of the directories for selected events output.
Definition: GETActarEventReader.hh:314
TH2 * h_eyt
X-T pads signal amplitude histogram.
Definition: GETActarEventReader.hh:194
int ip_noise
Parameter for array of channels noise.
Definition: GETActarEventReader.hh:259
virtual int WriteSelectedEvent()
Definition: GETActarEventReader.cpp:3600
#define GET_RUN_FAMILY_MAX
! Maximum number of histogram families to reset/save at run start/stop
Definition: GETActarEventReader.hh:35
int ip_mmax_sum
Parameter index for GET signal sum from multiple maxima analysis.
Definition: GETActarEventReader.hh:251
u_int selEventFileSub[16]
Selected events sub-file number.
Definition: GETActarEventReader.hh:318
TH2 * h_ext
X-T pads signal amplitude histogram.
Definition: GETActarEventReader.hh:193
virtual bool RunChanged() const
Definition: GETActarEventReader.hh:552
virtual void PresetLoadedAnalysis()
Definition: GETActarEventReader.cpp:3113
int ip_read_mult
Readout channels multiplicity parameter.
Definition: GETActarEventReader.hh:256
Filter * selFilterPtr[16]
Pointer to the filters for event selection.
Definition: GETActarEventReader.hh:322
int * ip_chan_fit
Parameter index for single channels fitted signal.
Definition: GETActarEventReader.hh:276
virtual int CloseSelectedEventsFile(u_int nf)
Definition: GETActarEventReader.cpp:3528