GET library
GETActarTpcAnalyser.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GETActarTpcAnalyser.hh
3  *
4  * Header file for the GETActarTpcAnalyser class.
5  */
6 //======================================================================
7 
8 #ifndef GET_ACTAR_TPC_ANALYSER_HH
9 #define GET_ACTAR_TPC_ANALYSER_HH
10 
11 // includes from current library
12 #include "GETActarTpc.hh"
13 #include "GETSystemAnalyser.hh"
14 
15 
16 //======================================================================
17 /*! \class GETActarTpcAnalyser
18  *
19  * This class is a specialized analyser class (derived from GETSystemAnalyser)
20  * for GETActarTpc (derived from GETSystem).
21  *
22  * The analysis available in addition to the ones of the base class are:
23  *
24  * - single events analysis:
25  * - automatic histograms on events data:
26  * pads signal histograms (amplitude and time of the maximum
27  * channel signal)
28  * - OFF-track signal analysis (and optionally corresponding histograms
29  * if the functions to create these histograms have been called)
30  *
31  * \section get_analyser_off_track Off-track signal analysis
32  *
33  * The off-track signal analysis and correction has been developped in
34  * order to evaluate the mesh-induced signal on pads that are not
35  * supposed to collect charges, but that see a mirror signal from the
36  * charges on the mesh.
37  *
38  * A copy of the pads mask is created to define pads around the real
39  * track.
40  * The signal from these pads in averaged to build the <B>off-track signal</B>,
41  * that is removed from all signal channels if the correction is set on
42  * (the off-track analysis can be set, without correction channels output).
43  *
44  * \image html GETOffTrackAnalysisR.png
45  * The picture above shows a track from an event of the ACTAR TPC demonstrator.
46  * The top-left figure is the signal amplitude on the pads, that is used
47  * to determine the hit mask (in-track pads of bottom-left) picture and
48  * the pads that are used to compute off-track signal (off-track pads).
49  * The off track signal (bottom-right picture) can be compared to the
50  * average effective signal, by inversion and scaling (up-right picture).
51  *
52  */
54 {
55  //------------------------------------------------------------
56  /*! \object_doc */
58  //------------------------------------------------------------
59 
60  protected:
61  GETActarTpc * actar_ptr; ///< Pointer to the GETActarTpc object (which is the GETSystem pointer of the base classe)
62 
63  // - pad display of events
64  TH2D * h_xy_hits; ///< Histogram with pads hits
65  TH2D * h_xy_time; ///< Histogram with pads event time
66  TH2D * h_xy_ampl; ///< Histogram with pads event amplitude
67  TH2D * h_xt_ampl; ///< Histogram with pads event amplitude
68  TH2D * h_yt_ampl; ///< Histogram with pads event amplitude
69  TH3D * h_xyt; ///< Histogram with 2D signal with third T dimension
70  TH1D * h_x_proj; ///< Histogram with pads event amplitude
71  TH1D * h_y_proj; ///< Histogram with pads event amplitude
72  TH1D * h_t_proj; ///< Histogram with pads event amplitude
73 
74  GETHitMaskXY * pad_mask; ///< Pointer to the hit mask (same as base class hit mask, but known as GETHitMaskXY)
75 
76  // variables to noise analysis
77  TH2D * h_xy_rms; ///< Pointer to the pads RMS histogram
78 
79  // variables related to undershoot analysis
80  bool off_track_on; ///< Whether off-track analysis is ON
81  bool off_track_cor; ///< Whether to apply off-track correction to channels output signal
82  int off_space; ///< Pads separation between track and off-track pads
83  GETHitMaskXY off_mask; ///< Mask for X-Y off-track analysis
84  GETSample sum_in_track; ///< Sample with the sum of hit pads
85  GETSample sum_off_track; ///< Sample with the sum of pads out of track
86  TH1D * h_mean_in_track; ///< Histogram with summed signals of track pads
87  TH1D * h_mean_off_track; ///< Histogram with summed signals of off-track pads
88  TH2D * h_mask_in; ///< Pad histogram with track pattern
89  TH2D * h_mask_off; ///< Pad histogram with off-track pattern
90 
91  public:
92  //----------------------------------------------------------
93  /** @name Constructors, affectation, destructor */
94  //@{
95  GETActarTpcAnalyser ( GETActarTpc * get = NULL );
96  virtual ~GETActarTpcAnalyser ( );
97  //@}
98 
99  //----------------------------------------------------------
100  /** @name General functions */
101  //@{
102  virtual void Reset ( );
103  virtual int SetSystem ( GETSystem * gptr );
104  //@}
105 
106  //----------------------------------------------------------
107  /** @name Main analysis functions, called by GETSystem */
108  //@{
109  virtual void ClearAnalysis ( );
110 
111  virtual void ClearEvent ( );
112  virtual int AnalyseRawEvent ( );
113  virtual int AnalyseCorEvent ( );
114  //@}
115 
116  //----------------------------------------------------------
117  /** @name Predefined analysis configuration files */
118  //@{
119  virtual bool ConfigCommand ( const GString & code, const GString & args = "", FILE * fptr = NULL );
120  //@}
121 
122  //----------------------------------------------------------
123  /** @name Pads signal automatic histograms */
124  //@{
125  virtual double ComputeSumInt ( bool mask = true );
126  virtual double ComputeSumMax ( bool mask = true );
127 
128  TH2D * CreateXYtimeHisto ( const string & name = "GET_XY_Time" ); // inline
129  TH2D * CreateXYhitsHisto ( const string & name = "GET_XY_Hits" ); // inline
130  TH2D * CreateXYamplitudeHisto ( const string & name = "GET_XY_Amplitude" ); // inline
131  TH2D * CreateXTamplitudeHisto ( const string & name = "GET_XT_Amplitude" ); // inline
132  TH2D * CreateYTamplitudeHisto ( const string & name = "GET_YT_Amplitude" ); // inline
133  TH3D * CreateXYTHisto ( const string & name = "GET_XYT", int nt = 512, double t0 = 0., double t1 = 512. ); // inline
134  TH1D * CreateXprojectionHisto ( const string & name = "GET_X_Projection" ); // inline
135  TH1D * CreateYprojectionHisto ( const string & name = "GET_Y_Projection" ); // inline
136  TH1D * CreateTprojectionHisto ( const string & name = "GET_T_Projection" ); // inline
137 
138  TH2D * GetXYhitsHisto ( ) const; // inline
139  TH2D * GetXYtimeHisto ( ) const; // inline
140  TH2D * GetXYamplitudeHisto ( ) const; // inline
141  TH2D * GetXTamplitudeHisto ( ) const; // inline
142  TH2D * GetYTamplitudeHisto ( ) const; // inline
143  TH3D * GetXYTHisto ( ) const; // inline
144  TH1D * GetXprojectionHisto ( ) const; // inline
145  TH1D * GetYprojectionHisto ( ) const; // inline
146  TH1D * GetTprojectionHisto ( ) const; // inline
147  //@}
148 
149  //----------------------------------------------------------
150  /** @name Noise analysis (redefined from GETSystemAnalyser) */
151  //@{
152  virtual void SetNoiseRange ( u_int i0 = 2, u_int i1 = 509 );
153  TH2D * GetChannelsNoiseHistoXY ( ) const; // inline
154 
155  virtual int ProcessNoiseAnalysis ( );
156  //@}
157 
158  //----------------------------------------------------------
159  /** @name Off-track signal analysis */
160  //@{
161  virtual void SetOffTrackCorrection ( int spc = 1 );
162  virtual void InitOffTrackAnalysis ( int spc = 1 );
163  bool IsOffTrackAnalysisON ( ) const; // inline
164  bool IsOffTrackCorrectionON ( ) const; // inline
165  virtual const GETHitMaskXY & GetOffTrackMask ( ) const; // inline
166  virtual GETHitMaskXY & GetOffTrackMask ( ); // inline
167 
168  // the histograms are not created automatically
169  TH1D * CreateInTrackMeanHisto ( const string & hname = "MeanInTrackSignal" );
170  TH1D * CreateOffTrackMeanHisto ( const string & hname = "MeanOffTrackSignal" );
171  TH2D * CreateInTrackPatternHisto ( const string & hname = "PatternInTrack" );
172  TH2D * CreateOffTrackPatternHisto ( const string & hname = "PatternOffTrack" );
173 
174  virtual int ProcessOffTrackAnalysis ( );
175  virtual int ApplyOffTrackCorrection ( );
176  virtual int GetOffTrackPadsCount ( ) const; // inline
177 
178  GETSample & GetInTrackMeanSample ( ); // inline
179  GETSample & GetOffTrackMeanSample ( ); // inline
180  TH1D * GetInTrackMeanHisto ( ); // inline
181  TH1D * GetOffTrackMeanHisto ( ); // inline
182  TH2D * GetInTrackPatternHisto ( ); // inline
183  TH2D * GetOffTrackPatternHisto ( ); // inline
184  //@}
185 
186  //----------------------------------------------------------
187  /** @name Pads signal histograms general functions */
188  //@{
189  TH2D * CreatePadHistogram ( const string & name );
190  TH3D * CreateHistogram3D ( const string & name, int nt, double t0, double t1 );
191  TH2D * CreateHistogramXT ( const string & name, int nt, double t0, double t1 );
192  TH2D * CreateHistogramYT ( const string & name, int nt, double t0, double t1 );
193  TH2D * CreateHistogramXT ( const string & name );
194  TH2D * CreateHistogramYT ( const string & name );
195  TH1D * CreateHistogramX ( const string & name );
196  TH1D * CreateHistogramY ( const string & name );
197  TH1D * CreateHistogramT ( const string & name );
198 
199  int FillPadHistogram ( TH2 * hptr, u_short mode = GET::dataMaxSignal );
200  int FillHistogram3D ( TH3 * hptr, double toffset = 0., u_short mode = 0 );
201  int FillHistogramXTmax ( TH2 * hptr, double toffset = 0., u_short mode = 0 );
202  int FillHistogramYTmax ( TH2 * hptr, double toffset = 0., u_short mode = 0 );
203 
204  virtual int FillAutoHistograms ( );
205 
206  int Export3D_POV ( const string & fname, u_short mode = 0 );
207  int ExportPads_POV ( const string & fname, u_short mode = 0 );
208  int Export3D_POV ( FILE * fptr, u_short mode = 0 );
209  int ExportPads_POV ( FILE * fptr, u_short mode = 0 );
210  //@}
211 
212  //----------------------------------------------------------
213  /** @name ROOT related functions */
214  //@{
215  public:
216 
217  /*! for use within ROOT.*/
219  //@}
220 };
221 
222 
223 //----------------------------------------------------------------------
224 // Inline functions
226 
227 
228 //======================================================================
229 #endif
230 
TH2D * CreateXYhitsHisto(const string &name="GET_XY_Hits")
Definition: GETActarTpcAnalyser.icc:13
int Export3D_POV(const string &fname, u_short mode=0)
Definition: GETActarTpcAnalyser.cpp:1668
virtual int AnalyseCorEvent()
Definition: GETActarTpcAnalyser.cpp:205
virtual bool ConfigCommand(const GString &code, const GString &args="", FILE *fptr=NULL)
Definition: GETActarTpcAnalyser.cpp:379
TH2D * CreatePadHistogram(const string &name)
Definition: GETActarTpcAnalyser.cpp:879
TH2D * CreateYTamplitudeHisto(const string &name="GET_YT_Amplitude")
Definition: GETActarTpcAnalyser.icc:43
TH1D * CreateYprojectionHisto(const string &name="GET_Y_Projection")
Definition: GETActarTpcAnalyser.icc:59
bool IsOffTrackAnalysisON() const
Definition: GETActarTpcAnalyser.icc:136
GETSample & GetInTrackMeanSample()
Definition: GETActarTpcAnalyser.icc:148
int FillHistogramYTmax(TH2 *hptr, double toffset=0., u_short mode=0)
Definition: GETActarTpcAnalyser.cpp:1458
TH1D * CreateInTrackMeanHisto(const string &hname="MeanInTrackSignal")
Definition: GETActarTpcAnalyser.cpp:613
GETActarTpc * actar_ptr
Pointer to the GETActarTpc object (which is the GETSystem pointer of the base classe) ...
Definition: GETActarTpcAnalyser.hh:61
TH2D * h_mask_off
Pad histogram with off-track pattern.
Definition: GETActarTpcAnalyser.hh:89
virtual double ComputeSumInt(bool mask=true)
Definition: GETActarTpcAnalyser.cpp:491
bool IsOffTrackCorrectionON() const
Definition: GETActarTpcAnalyser.icc:140
TH3D * h_xyt
Histogram with 2D signal with third T dimension.
Definition: GETActarTpcAnalyser.hh:69
TH2D * GetInTrackPatternHisto()
Definition: GETActarTpcAnalyser.icc:164
TH1D * CreateOffTrackMeanHisto(const string &hname="MeanOffTrackSignal")
Definition: GETActarTpcAnalyser.cpp:636
GETHitMaskXY off_mask
Mask for X-Y off-track analysis.
Definition: GETActarTpcAnalyser.hh:83
TH3D * CreateXYTHisto(const string &name="GET_XYT", int nt=512, double t0=0., double t1=512.)
Definition: GETActarTpcAnalyser.icc:76
TH2D * GetChannelsNoiseHistoXY() const
Definition: GETActarTpcAnalyser.icc:122
static const u_short dataMaxSignal
Maximum value of signal data.
Definition: GETCommon.hh:115
virtual int ProcessNoiseAnalysis()
Definition: GETActarTpcAnalyser.cpp:325
TH1D * h_y_proj
Histogram with pads event amplitude.
Definition: GETActarTpcAnalyser.hh:71
virtual int GetOffTrackPadsCount() const
Definition: GETActarTpcAnalyser.icc:144
TH2D * CreateHistogramXT(const string &name, int nt, double t0, double t1)
Definition: GETActarTpcAnalyser.cpp:905
ClassDef(GETActarTpcAnalyser, 0)
virtual void ClearEvent()
Definition: GETActarTpcAnalyser.cpp:166
virtual void SetNoiseRange(u_int i0=2, u_int i1=509)
Definition: GETActarTpcAnalyser.cpp:303
virtual int FillAutoHistograms()
Definition: GETActarTpcAnalyser.cpp:1566
TH1D * GetXprojectionHisto() const
Definition: GETActarTpcAnalyser.icc:107
virtual void Reset()
Definition: GETActarTpcAnalyser.cpp:66
TH1D * CreateHistogramT(const string &name)
Definition: GETActarTpcAnalyser.cpp:1021
TH2D * CreateXYtimeHisto(const string &name="GET_XY_Time")
Definition: GETActarTpcAnalyser.icc:20
int FillPadHistogram(TH2 *hptr, u_short mode=GET::dataMaxSignal)
Definition: GETActarTpcAnalyser.cpp:1056
int ExportPads_POV(const string &fname, u_short mode=0)
Definition: GETActarTpcAnalyser.cpp:1693
virtual void SetOffTrackCorrection(int spc=1)
Definition: GETActarTpcAnalyser.cpp:568
int off_space
Pads separation between track and off-track pads.
Definition: GETActarTpcAnalyser.hh:82
TH2D * CreateXYamplitudeHisto(const string &name="GET_XY_Amplitude")
Definition: GETActarTpcAnalyser.icc:28
TH1D * h_x_proj
Histogram with pads event amplitude.
Definition: GETActarTpcAnalyser.hh:70
TH2D * GetXTamplitudeHisto() const
Definition: GETActarTpcAnalyser.icc:86
TH2D * h_xy_ampl
Histogram with pads event amplitude.
Definition: GETActarTpcAnalyser.hh:66
virtual void ClearAnalysis()
Definition: GETActarTpcAnalyser.cpp:154
TH2D * h_xy_time
Histogram with pads event time.
Definition: GETActarTpcAnalyser.hh:65
TH2D * CreateXTamplitudeHisto(const string &name="GET_XT_Amplitude")
Definition: GETActarTpcAnalyser.icc:35
Definition: GETHitMaskXY.hh:25
virtual int SetSystem(GETSystem *gptr)
Definition: GETActarTpcAnalyser.cpp:114
TH1D * h_t_proj
Histogram with pads event amplitude.
Definition: GETActarTpcAnalyser.hh:72
TH2D * CreateHistogramYT(const string &name, int nt, double t0, double t1)
Definition: GETActarTpcAnalyser.cpp:931
GETSample sum_in_track
Sample with the sum of hit pads.
Definition: GETActarTpcAnalyser.hh:84
virtual int ProcessOffTrackAnalysis()
Definition: GETActarTpcAnalyser.cpp:709
TH2D * GetXYhitsHisto() const
Definition: GETActarTpcAnalyser.icc:98
TH1D * GetTprojectionHisto() const
Definition: GETActarTpcAnalyser.icc:115
bool off_track_on
Whether off-track analysis is ON.
Definition: GETActarTpcAnalyser.hh:80
int FillHistogram3D(TH3 *hptr, double toffset=0., u_short mode=0)
Definition: GETActarTpcAnalyser.cpp:1186
TH2D * GetXYamplitudeHisto() const
Definition: GETActarTpcAnalyser.icc:82
TH2D * CreateInTrackPatternHisto(const string &hname="PatternInTrack")
Definition: GETActarTpcAnalyser.cpp:661
GETActarTpcAnalyser(GETActarTpc *get=NULL)
Definition: GETActarTpcAnalyser.cpp:19
virtual ~GETActarTpcAnalyser()
Definition: GETActarTpcAnalyser.cpp:56
TH2D * CreateOffTrackPatternHisto(const string &hname="PatternOffTrack")
Definition: GETActarTpcAnalyser.cpp:683
TH1D * CreateTprojectionHisto(const string &name="GET_T_Projection")
Definition: GETActarTpcAnalyser.icc:66
TH1D * CreateXprojectionHisto(const string &name="GET_X_Projection")
Definition: GETActarTpcAnalyser.icc:52
GETHitMaskXY * pad_mask
Pointer to the hit mask (same as base class hit mask, but known as GETHitMaskXY)
Definition: GETActarTpcAnalyser.hh:74
GETSample sum_off_track
Sample with the sum of pads out of track.
Definition: GETActarTpcAnalyser.hh:85
Definition: GETActarTpcAnalyser.hh:53
TH2D * h_xy_hits
Histogram with pads hits.
Definition: GETActarTpcAnalyser.hh:64
virtual int ApplyOffTrackCorrection()
Definition: GETActarTpcAnalyser.cpp:813
TH3D * CreateHistogram3D(const string &name, int nt, double t0, double t1)
Definition: GETActarTpcAnalyser.cpp:855
TH1D * h_mean_in_track
Histogram with summed signals of track pads.
Definition: GETActarTpcAnalyser.hh:86
RRealSampleFFT GETSample
Define the data type for samples.
Definition: GETCommon.hh:27
TH2D * GetOffTrackPatternHisto()
Definition: GETActarTpcAnalyser.icc:168
int FillHistogramXTmax(TH2 *hptr, double toffset=0., u_short mode=0)
Definition: GETActarTpcAnalyser.cpp:1337
TH2D * h_mask_in
Pad histogram with track pattern.
Definition: GETActarTpcAnalyser.hh:88
TH1D * CreateHistogramY(const string &name)
Definition: GETActarTpcAnalyser.cpp:1000
virtual int AnalyseRawEvent()
Definition: GETActarTpcAnalyser.cpp:192
Definition: GETSystemAnalyser.hh:281
TH2D * h_yt_ampl
Histogram with pads event amplitude.
Definition: GETActarTpcAnalyser.hh:68
TH2D * h_xt_ampl
Histogram with pads event amplitude.
Definition: GETActarTpcAnalyser.hh:67
bool off_track_cor
Whether to apply off-track correction to channels output signal.
Definition: GETActarTpcAnalyser.hh:81
TH1D * CreateHistogramX(const string &name)
Definition: GETActarTpcAnalyser.cpp:979
TH2D * GetYTamplitudeHisto() const
Definition: GETActarTpcAnalyser.icc:90
virtual double ComputeSumMax(bool mask=true)
Definition: GETActarTpcAnalyser.cpp:529
Definition: GETActarTpc.hh:28
virtual void InitOffTrackAnalysis(int spc=1)
Definition: GETActarTpcAnalyser.cpp:586
TH3D * GetXYTHisto() const
Definition: GETActarTpcAnalyser.icc:102
TH2D * h_xy_rms
Pointer to the pads RMS histogram.
Definition: GETActarTpcAnalyser.hh:77
TH1D * GetYprojectionHisto() const
Definition: GETActarTpcAnalyser.icc:111
TH1D * GetInTrackMeanHisto()
Definition: GETActarTpcAnalyser.icc:156
virtual const GETHitMaskXY & GetOffTrackMask() const
Definition: GETActarTpcAnalyser.icc:128
TH1D * h_mean_off_track
Histogram with summed signals of off-track pads.
Definition: GETActarTpcAnalyser.hh:87
TH2D * GetXYtimeHisto() const
Definition: GETActarTpcAnalyser.icc:94
GObject(GETActarTpcAnalyser)
Definition: GETSystem.hh:126
TH1D * GetOffTrackMeanHisto()
Definition: GETActarTpcAnalyser.icc:160
GETSample & GetOffTrackMeanSample()
Definition: GETActarTpcAnalyser.icc:152