ARTEMIS-CRIB
 
Loading...
Searching...
No Matches
TTGTIKProcessor.h
Go to the documentation of this file.
1/**
2 * @file TTGTIKProcessor.h
3 * @brief Processor for reconstructing reaction positions using the Thick Gas Target Inverse Kinematics (TGTIK) method.
4 * @author Kodai Okawa <okawa@cns.s.u-tokyo.ac.jp>
5 * @date 2023-08-01 11:11:02
6 * @note last modified: 2025-03-05 18:29:56
7 * @details
8 */
9
10#ifndef CRIB_TTGTIKPROCESSOR_H_
11#define CRIB_TTGTIKPROCESSOR_H_
12
14#include <TProcessor.h>
15#include <TSrim.h> // TSrim library
16#include <TTrack.h>
17
18class TClonesArray;
19
20namespace art::crib {
21
22/**
23 *
24 * @class TTGTIKProcessor
25 * @brief Calculates the reaction position using telescope and tracking data.
26 *
27 * This class read two input data from a TClonesArray("art::crib::TTelescopeData")
28 * and a TClonesArray("art::TTrack").
29 * It applies Thick Gas Target Method and get reaction position and Ecm.
30 *
31 * ### Example Steering File
32 *
33 * ```yaml
34 * Processor:
35 * - name: MyTTGTIKProcessor
36 * type: art::crib::TTGTIKProcessor
37 * parameter:
38 * DetectorParameter: prm_detectors # [TString] Name of the telescope parameter collection (detector parameters)
39 * ExcitedEnergy: -1 # [Double_t] Excited state energy (MeV); use a negative value if not applicable
40 * InitialBeamEnergy: 0 # [Double_t] Initial beam energy (in MeV) immediately after the exit window
41 * InputCollection: tel # [TString] Input collection of telescope data objects (derived from TTelescopeData)
42 * InputTrackCollection: track # [TString] Input collection of tracking data objects (derived from TTrack)
43 * OutputCollection: result # [TString] Output collection containing reaction reconstruction information using the TGTIK method
44 * OutputTransparency: 0 # [Bool_t] Output is persistent if false (default)
45 * ParticleAArray: [] # [IntVec_t] Array of mass numbers (A) for reaction particles
46 * ParticleZArray: [] # [IntVec_t] Array of atomic numbers (Z) for reaction particles
47 * TargetName: "" # [TString] Name of the target gas (used in TSrim calculation)
48 * TargetParameter: prm_targets # [TString] Name of the target parameter collection
49 * TargetPressure: 0 # [Double_t] Target gas pressure in Torr
50 * TargetTemperature: 0 # [Double_t] Target gas temperature in Kelvin
51 * UseCenterPosition: 0 # [Bool_t] Flag to use the detector's center position (useful when the DSSSD is not operational)
52 * UseCustomFunction: 0 # [Bool_t] Flag to enable custom processing functions for additional corrections
53 * Verbose: 1 # [Int_t] verbose level (default 1 : non quiet)
54 * ```
55 *
56 * \warning `UseCustomFunction` is designed for specific analysis, currently for 26Si(a, p) analysis.
57 *
58 * ### Kinematics Calculation
59 *
60 * This processor is using classical (non-relativistic) kinematics.
61 * Okawa note the relationship. See my master thesis (Japanese) for the details.
62 *
63 * Consider Ion1 + Ion2 -> Ion3 + Ion4 reaction, that is, Ion2(Ion1, Ion3)Ion4 reaction.
64 *
65 * - \f$ M \f$: mass
66 * - \f$ v \f$: velocity
67 * - \f$ v_2 = 0 \f$: for the target ion
68 * - \f$ {}_{\mathrm{CM}} \f$: center-of-mass system
69 * - \f$ \theta\f$: scatter angle of Ion3
70 * - \f$ Q \f$: Q-value
71 *
72 * Based on the relationship between the center-of-mass frame and the laboratory frame,
73 *
74 * \f[
75 * \begin{align}
76 * v_{\mathrm{CM}} &= \frac{M_2}{M_1 + M_2} v_1 \\
77 * v_{1\mathrm{CM}} &= v_1 - v_{\mathrm{CM}} = \frac{M_2}{M_1}v_{\mathrm{CM}} \\
78 * v_{2\mathrm{CM}} &= 0 - v_{\mathrm{CM}} = -v_{\mathrm{CM}}
79 * \end{align}
80 * \f]
81 *
82 * The speed of the center of mass, \f$ v_{\mathrm{CM}} \f$, and kinetic energy, \f$ E_{\mathrm{CM}} \f$
83 * can be expressed as follows based on the definition of the center of mass.
84 *
85 * \f[
86 * \begin{align}
87 * E_{\mathrm{CM}} &= \frac{M_2(M_1 + M_2)}{2M_1} v_{\mathrm{CM}}^2 \\
88 * &= \alpha v_{\mathrm{CM}}^2
89 * \end{align}
90 * \f]
91 *
92 * Here, \f$ \alpha \f$ is defined as:
93 *
94 * \f[
95 * \begin{align}
96 * \alpha = \frac{M_2(M_1 + M_2)}{2M_1}
97 * \end{align}
98 * \f]
99 *
100 * Based on the relationship between the reaction Q-value and the conservation laws,
101 *
102 * \f[
103 * \begin{align}
104 * \frac{1}{2}M_1 v_{1\mathrm{CM}}^2 + \frac{1}{2}M_2 v_{2\mathrm{CM}}^2 + Q &= \frac{1}{2}M_3 v_{3\mathrm{CM}}^2 + \frac{1}{2}M_4 v_{4\mathrm{CM}}^2 \\
105 * M_1 v_{1\mathrm{CM}} &= M_2 v_{2\mathrm{CM}} \\
106 * M_3 v_{3\mathrm{CM}} &= M_4 v_{4\mathrm{CM}} \\
107 * \end{align}
108 * \f]
109 *
110 * Cancelling \f$ v_{4\mathrm{CM}} \f$, we obtain:
111 * \f[
112 * \begin{align}
113 * \alpha v_{\mathrm{CM}}^2 + Q &= \frac{M_3(M_3 + M_4)}{2M_4}v_{3\mathrm{CM}}^2 \\
114 * \alpha v_{\mathrm{CM}}^2 + Q &= \beta v_{3\mathrm{CM}}^2
115 * \end{align}
116 * \f]
117 *
118 * Here, \f$ \beta \f$ is defined as:
119 *
120 * \f[
121 * \begin{align}
122 * \beta = \frac{M_3(M_3+M_4)}{2M_4}
123 * \end{align}
124 * \f]
125 *
126 * For Ion 3, the velocity component perpendicular to the z-axis remains unchanged between the LAB and CM frames,
127 * while the parallel component can be transformed using vcm. Therefore,
128 *
129 * \f[
130 * \begin{align}
131 * v_{3\mathrm{CM}}\sin{\theta_{\mathrm{CM}}} &= v_3\sin{\theta} \\
132 * v_{3\mathrm{CM}}\cos{\theta_{\mathrm{CM}}} &= v_3\cos{\theta} - v_{\mathrm{CM}}
133 * \end{align}
134 * \f]
135 *
136 * Cancelling \f$ \theta_{\mathrm{CM}} \f$ from these two equations, we obtain:
137 *
138 * \f[
139 * \begin{align}
140 * v_{3\mathrm{cm}}^2 &= v_3^2 -2v_3 v_{\mathrm{CM}}\cos\theta + v_{\mathrm{cm}}^2
141 * \end{align}
142 * \f]
143 *
144 * \f$ v_3 \f$ and \f$ \theta \f$ can be considered observable quantities.
145 * Cancelling \f$ v_{3\mathrm{CM}} \f$, we obtain:
146 *
147 * \f[
148 * \begin{align}
149 * \alpha v_{\mathrm{CM}}^2 + Q = \beta\left(v_3^2 -2v_3v_{\mathrm{cm}}\cos\theta + v_{\mathrm{CM}}^2\right) \\
150 * (\alpha - \beta)v_{\mathrm{CM}}^2 + 2(\beta v_3 \cos\theta)v_{\mathrm{CM}} + (Q - \beta v_3^2) = 0
151 * \end{align}
152 * \f]
153 *
154 * By solving this quadratic equation, various quantities can be obtained.
155 * These relationships are utilized in the methods of this class.
156 *
157 * In inverse kinematics, ion 4 is detected.
158 * Therefore, the indices 3 and 4 should be swapped,
159 * and the transformation \f$ \theta_{\mathrm{CM}} \rightarrow \pi - \theta_{\mathrm{CM}} \f$ should be applied.
160 */
161
163 public:
164 /**
165 * @brief Constructor.
166 */
168
169 /**
170 * @brief Default destructor.
171 */
172 ~TTGTIKProcessor() override;
173
174 /**
175 * @brief Initialize the processor with an event collection.
176 * @param col Pointer to the event collection.
177 */
178 void Init(TEventCollection *col) override;
179
180 /**
181 * @brief Main processing function.
182 */
183 void Process() override;
184
185 private:
186 // Collection names
187 TString fInputColName; ///< Name of the input telescope data collection (TTelescopeData)
188 TString fInputTrackColName; ///< Name of the input tracking data collection (TTrack)
189 TString fOutputColName; ///< Name of the output reaction information collection (TReactionInfo)
190 TString fDetectorParameterName; ///< Name of the detector parameter (TDetectorParameter)
191 TString fTargetParameterName; ///< Name of the target parameter (TTargetParameter)
192
193 // Data pointers
194 TClonesArray **fInData; ///<! Pointer to the input telescope data (TClonesArray of TTelescopeData)
195 TClonesArray **fInTrackData; ///<! Pointer to the input tracking data (TClonesArray of TTrack)
196 TClonesArray *fOutData; ///<! Pointer to the output reaction information (TClonesArray of TReactionInfo)
197
198 // Parameter pointers
199 TClonesArray *fDetectorPrm; ///<! Pointer to detector parameter objects (TClonesArray of TDetectorParameter)
200 TClonesArray *fTargetPrm; ///<! Pointer to target parameter objects (TClonesArray of TTargetParameter)
201
202 // Experimental parameters
203 Double_t fInitialBeamEnergy; ///< Beam energy immediately after the window (MeV)
204 TString fTargetName; ///< Name of the gas target used in TSrim calculations
205 Double_t fPressure; ///< Gas pressure in Torr
206 Double_t fTemperature; ///< Gas temperature in Kelvin
207 IntVec_t fParticleZArray; ///< Array of atomic numbers for reaction particles
208 IntVec_t fParticleAArray; ///< Array of mass numbers for reaction particles
209 Double_t fExcitedEnergy; ///< Excited state energy (MeV)
210 Bool_t fDoCustom; ///< Flag to enable custom processing
211 Bool_t fDoCenterPos; ///< Flag to use the detector center position
212
213 // TSrim calculator for energy loss computation
214 TSrim *srim; ///<! TSrim object to calculate energy loss
215
216 // Constants for bisection method
217 const Double_t kInitialMin = -250.0; ///< Initial minimum value for bisection method (mm)
218 const Double_t kInitialMax = 1000.0; ///< Initial maximum value for bisection method (mm)
219 const Double_t kEpsilon = 1.0e-3; ///< Convergence threshold for the bisection method
220 const Int_t kMaxIteration = 1000; ///< Maximum number of iterations for the bisection method
221
222 // Mass parameters (set these according to the reaction specifics)
223 Double_t M1;
224 Double_t M2;
225 Double_t M3_default;
226 Double_t M3;
227 Double_t M4;
228
229 /**
230 * @brief Calculate the reaction position along the Z-axis.
231 * @param track Pointer to the tracking data (TTrack).
232 * @param data Pointer to the telescope data (TTelescopeData).
233 * @return Calculated reaction Z position (mm).
234 */
235 Double_t GetReactionPosition(const TTrack *track, const TTelescopeData *data);
236
237 /**
238 * @brief (Deprecated) Newton method for calculating reaction position.
239 * @param track Pointer to the tracking data (TTrack).
240 * @param data Pointer to the telescope data (TTelescopeData).
241 * @return Calculated reaction Z position (mm).
242 */
243 Double_t newton(const TTrack *track, const TTelescopeData *data);
244
245 /**
246 * @brief Bisection method for calculating reaction position.
247 * @param track Pointer to the tracking data (TTrack).
248 * @param data Pointer to the telescope data (TTelescopeData).
249 * @return Calculated reaction Z position (mm).
250 */
251 Double_t bisection(const TTrack *track, const TTelescopeData *data);
252
253 /**
254 * @brief Target function for the bisection (and Newton) method.
255 * Computes the difference between the beam and detected particle center-of-mass energies.
256 * @param z Reaction position (mm).
257 * @param track Pointer to the tracking data (TTrack).
258 * @param data Pointer to the telescope data (TTelescopeData).
259 * @return Difference in center-of-mass energy (MeV).
260 */
261 Double_t TargetFunction(Double_t z, const TTrack *track, const TTelescopeData *data);
262
263 /**
264 * @brief Calculate the center-of-mass energy from beam data.
265 * @param z Reaction position (mm).
266 * @param track Pointer to the tracking data (TTrack).
267 * @return Calculated center-of-mass energy (MeV).
268 */
269 Double_t GetEcmFromBeam(Double_t z, const TTrack *track);
270
271 /**
272 * @brief Calculate the LAB energy and LAB angle from detected particle data.
273 * @param z Reaction position (mm).
274 * @param track Pointer to the tracking data (TTrack).
275 * @param data Pointer to the telescope data (TTelescopeData).
276 * @return A pair containing the LAB energy (MeV) and LAB angle (radian).
277 */
278 std::pair<Double_t, Double_t> GetELabALabPair(Double_t z, const TTrack *track, const TTelescopeData *data);
279
280 /**
281 * @brief Calculate the center-of-mass energy from detected particle data.
282 * @param z Reaction position (mm).
283 * @param track Pointer to the tracking data (TTrack).
284 * @param data Pointer to the telescope data (TTelescopeData).
285 * @return Calculated center-of-mass energy (MeV).
286 */
287 Double_t GetEcmFromDetectParticle(Double_t z, const TTrack *track, const TTelescopeData *data);
288
289 /**
290 * @brief Calculate the center-of-mass energy using relativistic kinematics.
291 * @param energy LAB energy (MeV).
292 * @param theta LAB angle (radian).
293 * @param low_e Lower bound for energy (MeV).
294 * @param high_e Upper bound for energy (MeV).
295 * @return Calculated center-of-mass energy (MeV).
296 */
297 Double_t GetEcm_kinematics(Double_t energy, Double_t theta, Double_t low_e, Double_t high_e);
298
299 /**
300 * @brief Calculate the center-of-mass energy using classical kinematics.
301 * @param energy LAB energy (MeV).
302 * @param theta LAB angle (radian).
303 * @return Calculated center-of-mass energy (MeV).
304 */
305 Double_t GetEcm_classic_kinematics(Double_t energy, Double_t theta);
306
307 /**
308 * @brief Recalculate the LAB angle after reconstruction.
309 * @param ELab LAB energy (MeV).
310 * @param Ecm Center-of-mass energy (MeV).
311 * @param ALab LAB angle (radian).
312 * @return Reconstructed LAB angle (radian).
313 */
314 Double_t GetCMAngle(Double_t ELab, Double_t Ecm, Double_t ALab);
315
316 /**
317 * @brief Generate a custom excited state energy.
318 * This function is used for custom processing (e.g., handling excited state effects).
319 * @param telID Identifier for the telescope.
320 * @param Etotal Total measured energy (MeV).
321 * @return Generated excited state energy (MeV).
322 */
323 Double_t GetCustomExcitedEnergy(Int_t telID, Double_t Etotal);
324
325 // Copy constructor (prohibited)
326 TTGTIKProcessor(const TTGTIKProcessor &rhs) = delete;
327 // Assignment operator (prohibited)
329
330 ClassDefOverride(TTGTIKProcessor, 1); ///< ROOT class definition macro.
331};
332} // namespace art::crib
333
334#endif // end of #ifndef CRIB_TTGTIKPROCESSOR_H_
Calculates the reaction position using telescope and tracking data.
IntVec_t fParticleAArray
Array of mass numbers for reaction particles.
const Double_t kEpsilon
Convergence threshold for the bisection method.
TClonesArray * fOutData
! Pointer to the output reaction information (TClonesArray of TReactionInfo)
Double_t newton(const TTrack *track, const TTelescopeData *data)
(Deprecated) Newton method for calculating reaction position.
TString fOutputColName
Name of the output reaction information collection (TReactionInfo)
TClonesArray ** fInData
! Pointer to the input telescope data (TClonesArray of TTelescopeData)
TClonesArray ** fInTrackData
! Pointer to the input tracking data (TClonesArray of TTrack)
const Int_t kMaxIteration
Maximum number of iterations for the bisection method.
const Double_t kInitialMax
Initial maximum value for bisection method (mm)
Double_t GetEcmFromBeam(Double_t z, const TTrack *track)
Calculate the center-of-mass energy from beam data.
Double_t GetEcmFromDetectParticle(Double_t z, const TTrack *track, const TTelescopeData *data)
Calculate the center-of-mass energy from detected particle data.
Double_t fPressure
Gas pressure in Torr.
Double_t GetCMAngle(Double_t ELab, Double_t Ecm, Double_t ALab)
Recalculate the LAB angle after reconstruction.
Double_t bisection(const TTrack *track, const TTelescopeData *data)
Bisection method for calculating reaction position.
Double_t fTemperature
Gas temperature in Kelvin.
TString fTargetParameterName
Name of the target parameter (TTargetParameter)
Double_t TargetFunction(Double_t z, const TTrack *track, const TTelescopeData *data)
Target function for the bisection (and Newton) method.
Double_t GetEcm_classic_kinematics(Double_t energy, Double_t theta)
Calculate the center-of-mass energy using classical kinematics.
IntVec_t fParticleZArray
Array of atomic numbers for reaction particles.
TString fInputTrackColName
Name of the input tracking data collection (TTrack)
TTGTIKProcessor & operator=(const TTGTIKProcessor &rhs)=delete
Double_t fInitialBeamEnergy
Beam energy immediately after the window (MeV)
void Init(TEventCollection *col) override
Initialize the processor with an event collection.
Bool_t fDoCustom
Flag to enable custom processing.
TTGTIKProcessor(const TTGTIKProcessor &rhs)=delete
Double_t GetReactionPosition(const TTrack *track, const TTelescopeData *data)
Calculate the reaction position along the Z-axis.
Double_t GetCustomExcitedEnergy(Int_t telID, Double_t Etotal)
Generate a custom excited state energy.
TClonesArray * fTargetPrm
! Pointer to target parameter objects (TClonesArray of TTargetParameter)
TString fInputColName
Name of the input telescope data collection (TTelescopeData)
TClonesArray * fDetectorPrm
! Pointer to detector parameter objects (TClonesArray of TDetectorParameter)
const Double_t kInitialMin
Initial minimum value for bisection method (mm)
TString fTargetName
Name of the gas target used in TSrim calculations.
Bool_t fDoCenterPos
Flag to use the detector center position.
void Process() override
Main processing function.
Double_t GetEcm_kinematics(Double_t energy, Double_t theta, Double_t low_e, Double_t high_e)
Calculate the center-of-mass energy using relativistic kinematics.
TString fDetectorParameterName
Name of the detector parameter (TDetectorParameter)
TSrim * srim
! TSrim object to calculate energy loss
std::pair< Double_t, Double_t > GetELabALabPair(Double_t z, const TTrack *track, const TTelescopeData *data)
Calculate the LAB energy and LAB angle from detected particle data.
Double_t fExcitedEnergy
Excited state energy (MeV)
ClassDefOverride(TTGTIKProcessor, 1)
ROOT class definition macro.
~TTGTIKProcessor() override
Default destructor.
return to the guide