MiniballSort
Loading...
Searching...
No Matches
Reaction.hh
Go to the documentation of this file.
1#ifndef __REACTION_HH
2#define __REACTION_HH
3
4#include <iostream>
5#include <iomanip>
6#include <vector>
7#include <algorithm>
8#include <memory>
9#include <string>
10#include <sstream>
11#include <map>
12
13#include "TSystem.h"
14#include "TEnv.h"
15#include "TMath.h"
16#include "TObject.h"
17#include "TString.h"
18#include "TFile.h"
19#include "TCutG.h"
20#include "TVector3.h"
21#include "TRandom.h"
22#include "TSpline.h"
23#include "TCanvas.h"
24#include "TGraph.h"
25
26// Settings header
27#ifndef __SETTINGS_HH
28# include "Settings.hh"
29#endif
30
31// Miniball Events tree
32#ifndef __MINIBALLEVTS_HH
33# include "MiniballEvts.hh"
34#endif
35
36// Header for geometry calibration
37#ifndef __MINIBALLGEOMETRY_HH
38# include "MiniballGeometry.hh"
39#endif
40
41// Make sure that the data and srim file are defined
42#ifndef AME_FILE
43# define AME_FILE "./data/mass_1.mas20"
44#endif
45#ifndef SRIM_DIR
46# define SRIM_DIR "./srim/"
47#endif
48
49const double p_mass = 938272.08816;
50const double n_mass = 939565.42052;
51const double u_mass = 931494.10242;
52const double e_mass = 510.99895026;
53
54// Element names
55const std::vector<std::string> gElName = {
56 "n","H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg",
57 "Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr",
58 "Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr",
59 "Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd",
60 "In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd",
61 "Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf",
62 "Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po",
63 "At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm",
64 "Bk","Cf","Es","Fm","Md","No","Lr","Rf","Db","Sg","Bh","Hs",
65 "Mt","Ds","Rg","Cn","Nh","Fl","Ms","Lv","Ts","Og","Uue","Ubn"
66};
67
68
71
72class MiniballParticle : public TObject {
73
74public:
75
76 // setup functions
79
80 // Get properties
81 inline double GetMass_u(){
82 return GetMass() / u_mass;
83 }; // returns mass in u
84 inline double GetMass(){
85 double mass = (double)GetN() * n_mass;
86 mass += (double)GetZ() * p_mass;
87 mass -= (double)GetA() * bindingE;
88 mass += GetEx();
89 return mass;
90 }; // returns mass in keV/c^2
91 inline int GetA(){ return A; }; // returns mass number
92 inline int GetZ(){ return Z; };
93 inline int GetN(){ return A-Z; };
94 inline std::string GetIsotope(){
95 return std::to_string( GetA() ) + gElName.at( GetZ() );
96 };
97 inline double GetBindingEnergy(){ return bindingE; };
98 inline double GetEnergyTot(){ return GetEnergy() + GetMass(); };
99 inline double GetBeta(){
100 return GetMomentum()/GetEnergyTot();
101 };
102 inline double GetBetaCoM(){
103 return GetMomentum()/(GetEnergyTot() + GetMass()) ;
104 };
105 inline double GetGamma(){
106 return 1.0 / TMath::Sqrt( 1.0 - TMath::Power( GetBeta(), 2.0 ) );
107 };
108 inline double GetGammaCoM(){
109 return 1.0 / TMath::Sqrt( 1.0 - TMath::Power( GetBetaCoM(), 2.0 ) );
110 };
111 inline double GetEnergy(){ return Elab; };
112 inline double GetEnergyCoM(){ return ECoM; };
113 inline double GetEx(){ return Ex; };
114 inline double GetTheta(){ return Theta; };
115 inline double GetThetaCoM(){ return ThetaCoM; };
116 inline double GetPhi(){ return Phi; };
117 inline TVector3 GetVector(){
118 TVector3 vec( 1, 0, 0 );
119 vec.SetTheta( GetTheta() );
120 vec.SetPhi( GetPhi() );
121 return vec;
122 };
123 inline double GetMomentum(){
125 double E = GetEnergyTot();
126 double m = GetMass();
127 return TMath::Sqrt(TMath::Power(E, 2.0) - TMath::Power(m, 2.0));
128 };
129
130 // Set properties
131 inline void SetA( int myA ){ A = myA; };
132 inline void SetZ( int myZ ){ Z = myZ; };
133 inline void SetBindingEnergy( double myBE ){ bindingE = myBE; };
134 inline void SetEnergy( double myElab ){ Elab = myElab; };
135 inline void SetEnergyCoM( double myECoM ){ ECoM = myECoM; };
136 inline void SetEx( double myEx ){ Ex = myEx; };
137 inline void SetTheta( double mytheta ){ Theta = mytheta; };
138 inline void SetThetaCoM( double mytheta ){ ThetaCoM = mytheta; };
139 inline void SetPhi( double myphi ){ Phi = myphi; };
140
141
142private:
143
144 // Properties of reaction particles
145 int A;
146 int Z;
147 double bindingE;
148 double Elab;
149 double ECoM;
150 double Ex;
151 double Theta;
152 double ThetaCoM;
153 double Phi;
154
155
156 ClassDef( MiniballParticle, 1 )
157
158};
159
160class MiniballReaction : public TObject {
161
162public:
163
164 // setup functions
165 MiniballReaction( std::string filename, std::shared_ptr<MiniballSettings> myset );
167
168 // Print the reaction data to a file
169 void PrintReaction( std::ostream &stream, std::string opt );
170
171 // Main functions
172 void AddBindingEnergy( short Ai, short Zi, TString ame_be_str );
173 std::shared_ptr<TCutG> ReadCutFile( std::string cut_filename, std::string cut_name );
174 void ReadMassTables();
175 void ReadReaction();
176 void SetFile( std::string filename ){
177 fInputFile = filename;
178 }
179 const std::string InputFile(){
180 return fInputFile;
181 }
182
183 // Get Doppler mode for calculation the velocity in the Doppler correction
184 inline unsigned char GetDopplerMode(){ return doppler_mode; };
185
186 // Get laser mode for histogramming
187 inline unsigned char GetLaserMode(){ return laser_mode; };
188
189 // Get values for geometry
190 inline double GetCDDistance( unsigned char det ){
191 if( det < cd_dist.size() ) return cd_dist.at(det);
192 else return 0.0;
193 };
194 inline double GetCDPhiOffset( unsigned char det ){
195 if( det < cd_offset.size() ) return cd_offset.at(det);
196 else return 0.0;
197 };
198 inline double GetCDDeadLayer( unsigned char det ){
199 if( det < dead_layer.size() ) return dead_layer.at(det);
200 else return 0.0;
201 };
202 inline unsigned int GetNumberOfParticleThetas() {
203 return set->GetNumberOfCDPStrips() * set->GetNumberOfCDDetectors();
204 };
205 inline std::vector<double> GetParticleThetas(){
206 std::vector<double> cd_angles;
207 for( unsigned char i = 0; i < set->GetNumberOfCDDetectors(); i++ )
208 for( unsigned char j = 0; j <= set->GetNumberOfCDPStrips(); j++ )
209 cd_angles.push_back( GetCDVector(i,0,(float)j-0.5,(float)0).Theta() * TMath::RadToDeg() );
210 std::sort( cd_angles.begin(), cd_angles.end() );
211 return cd_angles;
212 };
213 TVector3 GetCDVector( unsigned char det, unsigned char sec, float pid, float nid );
214 inline TVector3 GetCDVector( unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid ){
215 return GetCDVector( det, sec, (float)pid, (float)nid );
216 };
217 TVector3 GetParticleVector( unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid );
218 inline double GetParticleTheta( unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid ){
219 return GetParticleVector( det, sec, pid, nid ).Theta();
220 };
221 inline double GetParticlePhi( unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid ){
222 return GetParticleVector( det, sec, pid, nid ).Phi();
223 };
224 inline double GetParticleX( unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid ){
225 return GetParticleVector( det, sec, pid, nid ).X();
226 };
227 inline double GetParticleY( unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid ){
228 return GetParticleVector( det, sec, pid, nid ).Y();
229 };
230 inline double GetParticleZ( unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid ){
231 return GetParticleVector( det, sec, pid, nid ).Z();
232 };
233 inline TVector3 GetCDVector( std::shared_ptr<ParticleEvt> p ){
234 return GetCDVector( p->GetDetector(), p->GetSector(), p->GetStripP(), p->GetStripN() );
235 };
236 inline TVector3 GetParticleVector( std::shared_ptr<ParticleEvt> p ){
237 return GetParticleVector( p->GetDetector(), p->GetSector(), p->GetStripP(), p->GetStripN() );
238 };
239 inline double GetParticleTheta( std::shared_ptr<ParticleEvt> p ){
240 return GetParticleTheta( p->GetDetector(), p->GetSector(), p->GetStripP(), p->GetStripN() );
241 };
242 inline double GetParticlePhi( std::shared_ptr<ParticleEvt> p ){
243 return GetParticlePhi( p->GetDetector(), p->GetSector(), p->GetStripP(), p->GetStripN() );
244 };
245 inline double GetParticleX( std::shared_ptr<ParticleEvt> p ){
246 return GetParticleX( p->GetDetector(), p->GetSector(), p->GetStripP(), p->GetStripN() );
247 };
248 inline double GetParticleY( std::shared_ptr<ParticleEvt> p ){
249 return GetParticleY( p->GetDetector(), p->GetSector(), p->GetStripP(), p->GetStripN() );
250 };
251 inline double GetParticleZ( std::shared_ptr<ParticleEvt> p ){
252 return GetParticleZ( p->GetDetector(), p->GetSector(), p->GetStripP(), p->GetStripN() );
253 };
254
255 // Miniball geometry functions
256 inline void SetupCluster( unsigned char clu, double user_theta, double user_phi, double user_alpha, double user_r, double user_z) {
257 mb_geo[clu].SetupCluster(user_theta, user_phi, user_alpha, user_r, user_z);
258 }
259 inline double GetMiniballTheta( unsigned char clu ){
260 return mb_geo[clu].GetCluTheta();
261 };
262 inline double GetMiniballPhi( unsigned char clu ){
263 return mb_geo[clu].GetCluPhi();
264 };
265 inline double GetMiniballAlpha( unsigned char clu ){
266 return mb_geo[clu].GetCluAlpha();
267 };
268 inline double GetMiniballR( unsigned char clu ){
269 return mb_geo[clu].GetCluR();
270 };
271 inline double GetGammaTheta( unsigned char clu, unsigned char cry, unsigned char seg ){
272 return mb_geo[clu].GetSegTheta( cry, seg );
273 };
274 inline double GetGammaPhi( unsigned char clu, unsigned char cry, unsigned char seg ){
275 return mb_geo[clu].GetSegPhi( cry, seg );
276 };
277 inline double GetGammaX( unsigned char clu, unsigned char cry, unsigned char seg ){
278 return mb_geo[clu].GetSegX( cry, seg );
279 };
280 inline double GetGammaY( unsigned char clu, unsigned char cry, unsigned char seg ){
281 return mb_geo[clu].GetSegY( cry, seg );
282 };
283 inline double GetGammaZ( unsigned char clu, unsigned char cry, unsigned char seg ){
284 return mb_geo[clu].GetSegZ( cry, seg );
285 };
286 inline double GetGammaTheta( std::shared_ptr<GammaRayEvt> g ){
287 return GetGammaTheta( g->GetCluster(), g->GetCrystal(), g->GetSegment() );
288 };
289 inline double GetGammaPhi( std::shared_ptr<GammaRayEvt> g ){
290 return GetGammaPhi( g->GetCluster(), g->GetCrystal(), g->GetSegment() );
291 };
292 inline double GetGammaX( std::shared_ptr<GammaRayEvt> g ){
293 return GetGammaX( g->GetCluster(), g->GetCrystal(), g->GetSegment() );
294 };
295 inline double GetGammaY( std::shared_ptr<GammaRayEvt> g ){
296 return GetGammaY( g->GetCluster(), g->GetCrystal(), g->GetSegment() );
297 };
298 inline double GetGammaZ( std::shared_ptr<GammaRayEvt> g ){
299 return GetGammaZ( g->GetCluster(), g->GetCrystal(), g->GetSegment() );
300 };
301
302 // SPEDE and electron geometry
303 inline double GetSpedeDistance(){ return spede_dist; };
304 inline double GetSpedePhiOffset(){ return spede_offset; };
305 TVector3 GetSpedeVector( unsigned char seg, bool random = false );
306 TVector3 GetElectronVector( unsigned char seg );
307 inline double GetElectronTheta( unsigned char seg ){
308 return GetElectronVector(seg).Theta();
309 };
310 inline double GetElectronTheta( SpedeEvt *s ){
311 return GetElectronTheta( s->GetSegment() );
312 };
313 inline double GetElectronPhi( unsigned char seg ){
314 return GetElectronVector(seg).Phi();
315 };
316 inline double GetElectronPhi( SpedeEvt *s ){
317 return GetElectronPhi( s->GetSegment() );
318 };
319
320
321 // Identify the ejectile and recoil and calculate in Coulex
322 void IdentifyEjectile( std::shared_ptr<ParticleEvt> p, bool kinflag = false );
323 void IdentifyRecoil( std::shared_ptr<ParticleEvt> p, bool kinflag = false );
324 void CalculateEjectile();
325 void CalculateRecoil();
326
327 // Identify the light ion recoil in transfer
328 void TransferProduct( std::shared_ptr<ParticleEvt> p, bool kinflag = false );
329
330
331
332 // Reaction calculations
333 inline double GetQvalue(){
334 return Beam.GetMass() + Target.GetMass() -
336 };
337 inline double GetEnergyTotLab(){
339 };
340 inline double GetEnergyTotCM(){
341 double etot = TMath::Power( Beam.GetMass(), 2.0 );
342 etot += TMath::Power( Target.GetMass(), 2.0 );
343 etot += 2.0 * Beam.GetEnergyTot() * Target.GetMass();
344 etot = TMath::Sqrt( etot );
345 return etot;
346 };
347 inline double GetBeta(){
348 return Beam.GetBeta();
349 };
350 inline double GetBetaCoM(){
352 };
353 inline double GetGamma(){
354 return Beam.GetGamma();
355 };
356 inline double GetGammaCoM(){
357 return 1.0 / TMath::Sqrt( 1.0 - TMath::Power( GetBetaCoM(), 2.0 ) );
358 };
359 inline double GetTau(){
360 return Beam.GetMass() / Target.GetMass();
361 };
362 inline double GetEnergyPrime(){
363 return Beam.GetEnergy() - ( Ejectile.GetEx() + Recoil.GetEx() ) * ( 1.0 + GetTau() );
364 };
365 inline double GetEpsilon(){
366 return TMath::Sqrt( Beam.GetEnergy() / GetEnergyPrime() );
367 };
368
369
370 // Doppler correction
371 double DopplerShift( double gen, double pbeta, double costheta );
372 double DopplerCorrection( double gen, double gth, double gph, double pbeta, double ptheta, double pphi );
373 double DopplerCorrection( double gen, double gth, double gph, bool ejectile );
374 double DopplerCorrection( std::shared_ptr<GammaRayEvt> g, double pbeta, double ptheta, double pphi );
375 double DopplerCorrection( std::shared_ptr<GammaRayEvt> g, bool ejectile );
376 double DopplerCorrection( std::shared_ptr<SpedeEvt> s, bool ejectile );
377 double CosTheta( std::shared_ptr<GammaRayEvt> g, bool ejectile );
378 double CosTheta( std::shared_ptr<SpedeEvt> s, bool ejectile );
379
380
381 // Get EBIS times
382 inline double GetEBISOnTime(){ return EBIS_On; };
383 inline double GetEBISOffTime(){ return EBIS_Off; };
384 inline double GetEBISTimeRatio(){ return EBIS_On / ( EBIS_Off - EBIS_On ); };
385 inline double GetEBISFillRatio(){ return EBIS_ratio; };
386
387
388 // Get T1 times
389 inline bool GetT1Cut(){ return t1_cut; };
390 inline double GetT1MinTime(){ return t1_time[0]; };
391 inline double GetT1MaxTime(){ return t1_time[1]; };
392
393 // Get particle gamma coincidence times
394 inline double GetParticleGammaPromptTime( unsigned char i ){
395 // i = 0 for lower limit and i = 1 for upper limit
396 if( i < 2 ) return pg_prompt[i];
397 else return 0;
398 };
399 inline double GetParticleGammaRandomTime( unsigned char i ){
400 // i = 0 for lower limit and i = 1 for upper limit
401 if( i < 2 ) return pg_random[i];
402 else return 0;
403 };
405 return ( pg_prompt[1] - pg_prompt[0] ) / ( pg_random[1] - pg_random[0] );
406 };
408 return pg_ratio;
409 };
410 inline double GetGammaGammaPromptTime( unsigned char i ){
411 // i = 0 for lower limit and i = 1 for upper limit
412 if( i < 2 ) return gg_prompt[i];
413 else return 0;
414 };
415 inline double GetGammaGammaRandomTime( unsigned char i ){
416 // i = 0 for lower limit and i = 1 for upper limit
417 if( i < 2 ) return gg_random[i];
418 else return 0;
419 };
420 inline double GetGammaGammaTimeRatio(){
421 return ( gg_prompt[1] - gg_prompt[0] ) / ( gg_random[1] - gg_random[0] );
422 };
423 inline double GetGammaGammaFillRatio(){
424 return gg_ratio;
425 };
426 inline double GetParticleParticlePromptTime( unsigned char i ){
427 // i = 0 for lower limit and i = 1 for upper limit
428 if( i < 2 ) return pp_prompt[i];
429 else return 0;
430 };
431 inline double GetParticleParticleRandomTime( unsigned char i ){
432 // i = 0 for lower limit and i = 1 for upper limit
433 if( i < 2 ) return pp_random[i];
434 else return 0;
435 };
437 return ( pp_prompt[1] - pp_prompt[0] ) / ( pp_random[1] - pp_random[0] );
438 };
440 return pp_ratio;
441 };
442 inline double GetGammaElectronPromptTime( unsigned char i ){
443 // i = 0 for lower limit and i = 1 for upper limit
444 if( i < 2 ) return ge_prompt[i];
445 else return 0;
446 };
447 inline double GetGammaElectronRandomTime( unsigned char i ){
448 // i = 0 for lower limit and i = 1 for upper limit
449 if( i < 2 ) return ge_random[i];
450 else return 0;
451 };
453 return ( ge_prompt[1] - ge_prompt[0] ) / ( ge_random[1] - ge_random[0] );
454 };
456 return ge_ratio;
457 };
458 inline double GetElectronElectronPromptTime( unsigned char i ){
459 // i = 0 for lower limit and i = 1 for upper limit
460 if( i < 2 ) return ee_prompt[i];
461 else return 0;
462 };
463 inline double GetElectronElectronRandomTime( unsigned char i ){
464 // i = 0 for lower limit and i = 1 for upper limit
465 if( i < 2 ) return ee_random[i];
466 else return 0;
467 };
469 return ( ee_prompt[1] - ee_prompt[0] ) / ( ee_random[1] - ee_random[0] );
470 };
472 return ee_ratio;
473 };
474 inline double GetParticleElectronPromptTime( unsigned char i ){
475 // i = 0 for lower limit and i = 1 for upper limit
476 if( i < 2 ) return pe_prompt[i];
477 else return 0;
478 };
479 inline double GetParticleElectronRandomTime( unsigned char i ){
480 // i = 0 for lower limit and i = 1 for upper limit
481 if( i < 2 ) return pe_random[i];
482 else return 0;
483 };
485 return ( pe_prompt[1] - pe_prompt[0] ) / ( pe_random[1] - pe_random[0] );
486 };
488 return pe_ratio;
489 };
490
491 // Energy loss and stopping powers
492 double GetEnergyLoss( double Ei, double dist, std::unique_ptr<TGraph> &g );
493 bool ReadStoppingPowers( std::string isotope1, std::string isotope2, std::unique_ptr<TGraph> &g );
494
495
496 // Getter for target offsets
497 inline double GetOffsetX(){ return x_offset; };
498 inline double GetOffsetY(){ return y_offset; };
499 inline double GetOffsetZ(){ return z_offset; };
500
501 // Get cuts
502 inline std::shared_ptr<TCutG> GetEjectileCut(){ return ejectile_cut; };
503 inline std::shared_ptr<TCutG> GetRecoilCut(){ return recoil_cut; };
504 inline std::shared_ptr<TCutG> GetTransferCut(){ return transfer_cut; };
505 inline std::string GetTransferX(){ return transfercut_x; };
506 inline std::string GetTransferY(){ return transfercut_y; };
507
508 // Get particles
509 inline MiniballParticle* GetBeam(){ return &Beam; };
510 inline MiniballParticle* GetTarget(){ return &Target; };
511 inline MiniballParticle* GetEjectile(){ return &Ejectile; };
512 inline MiniballParticle* GetRecoil(){ return &Recoil; };
513
514 // Timing for coincidence
515 inline unsigned long long GetParticleTime(){ return particle_time; };
516 inline void ResetParticles(){
517 ejectile_detected = false;
518 recoil_detected = false;
519 transfer_detected = false;
520 };
521 inline void SetParticleTime( unsigned long long t ){ particle_time = t; };
522 inline bool IsEjectileDetected(){ return ejectile_detected; };
523 inline bool IsRecoilDetected(){ return recoil_detected; };
524 inline bool IsTransferDetected(){ return transfer_detected; };
525
526 // Events tree options
534
535 // Histogram options
536 inline bool HistWithoutAddback(){ return hist_wo_addback; };
537 inline bool HistWithAddback(){ return hist_w_addback; };
538 inline bool HistSegmentPhi(){ return hist_segment_phi; };
539 inline bool HistByCrystal(){ return hist_by_crystal; };
540 inline bool HistByMultiplicity(){ return hist_by_pmult; };
541 inline bool HistBySector(){ return hist_by_sector; };
542 inline bool HistByT1(){ return hist_by_t1; };
543 inline bool HistGammaGamma(){ return hist_gamma_gamma; };
544 inline bool HistElectron(){ return hist_electron; };
545 inline bool HistElectronGamma(){ return hist_electron_gamma; };
546 inline bool HistBeamDump(){ return hist_beam_dump; };
547 inline bool HistIonChamber(){ return hist_ion_chamb; };
548
549 // Histogram ranges
550 inline unsigned int HistGammaBins(){ return gamma_bins; }
551 inline double HistGammaMin(){ return gamma_range[0]; }
552 inline double HistGammaMax(){ return gamma_range[1]; }
553 inline unsigned int HistElectronBins(){ return electron_bins; }
554 inline double HistElectronMin(){ return electron_range[0]; }
555 inline double HistElectronMax(){ return electron_range[1]; }
556 inline unsigned int HistParticleBins(){ return particle_bins; }
557 inline double HistParticleMin(){ return particle_range[0]; }
558 inline double HistParticleMax(){ return particle_range[1]; }
559
560 ClassDef( MiniballReaction, 3 )
561
562private:
563
564 std::string fInputFile;
565
566 // Settings file
567 std::shared_ptr<MiniballSettings> set;
568
569 // Mass tables
570 std::map< std::string, double > ame_be;
571
572 // Reaction partners
574
575 // Reaction times and flags for coincidences
576 unsigned long long particle_time;
578
579 // Initial properties from file
580 double Eb;
581
582 // EBIS time windows
583 double EBIS_On;
584 double EBIS_Off;
585 double EBIS_ratio;
586
587 // T1 cut times
588 bool t1_cut;
589 double t1_time[2];
590
591 // Particle and Gamma coincidences windows
592 int pg_prompt[2];
593 int pg_random[2];
594 int gg_prompt[2];
595 int gg_random[2];
596 int pp_prompt[2];
597 int pp_random[2];
598 int ge_prompt[2];
599 int ge_random[2];
600 int ee_prompt[2];
601 int ee_random[2];
602 int pe_prompt[2];
603 int pe_random[2];
606
607 // Target thickness and offsets
609 double x_offset;
610 double y_offset;
611 double z_offset;
612
613 // Degrader material and thickness
615 std::string degrader_material;
616
617 // CD detector things
618 std::vector<double> cd_dist;
619 std::vector<double> cd_offset;
620 std::vector<double> dead_layer;
621
622 // Miniball detector things
624 std::vector<double> mb_theta, mb_phi, mb_alpha, mb_r;
625 unsigned char mb_type;
626
627 // SPEDE things
628 double spede_dist;
630
631 unsigned char doppler_mode;
638
639
640 unsigned char laser_mode;
642
643 // Events tree options
651
652 // Histogram options
665
666 // Histogram ranges
669
670 // Random numbers
671 TRandom rand;
672
673 // Cuts
678 TFile *cut_file;
679 std::shared_ptr<TCutG> ejectile_cut;
680 std::shared_ptr<TCutG> recoil_cut;
681 std::shared_ptr<TCutG> transfer_cut;
682
683 // Stopping powers
684 std::vector<std::unique_ptr<TGraph>> gStopping;
686
687};
688
689#endif
const double p_mass
mass of the proton in keV/c^2
Definition Reaction.hh:49
const std::vector< std::string > gElName
Definition Reaction.hh:55
const double n_mass
mass of the neutron in keV/c^2
Definition Reaction.hh:50
const double e_mass
mass of the electron in keV/c^2
Definition Reaction.hh:52
const double u_mass
atomic mass unit in keV/c^2
Definition Reaction.hh:51
Functions to convert Miniball angles read from the frame.
TVector3 GetVector()
Definition Reaction.hh:117
int A
mass number, A of the particle, obviously
Definition Reaction.hh:145
void SetBindingEnergy(double myBE)
Definition Reaction.hh:133
double ThetaCoM
theta in the centre-of-mass system in radians
Definition Reaction.hh:152
double GetEnergy()
Definition Reaction.hh:111
double GetBindingEnergy()
Definition Reaction.hh:97
double GetGammaCoM()
Definition Reaction.hh:108
void SetTheta(double mytheta)
Definition Reaction.hh:137
double GetMomentum()
Definition Reaction.hh:123
void SetPhi(double myphi)
Definition Reaction.hh:139
double GetTheta()
Definition Reaction.hh:114
double GetEnergyTot()
Definition Reaction.hh:98
void SetThetaCoM(double mytheta)
Definition Reaction.hh:138
double bindingE
binding energy per nucleon in keV/c^2
Definition Reaction.hh:147
double GetMass()
Definition Reaction.hh:84
void SetEx(double myEx)
Definition Reaction.hh:136
double Ex
excitation energy of the nucleus
Definition Reaction.hh:150
double GetThetaCoM()
Definition Reaction.hh:115
void SetZ(int myZ)
Definition Reaction.hh:132
double GetMass_u()
Definition Reaction.hh:81
double GetBetaCoM()
Definition Reaction.hh:102
double GetGamma()
Definition Reaction.hh:105
double GetPhi()
Definition Reaction.hh:116
void SetEnergy(double myElab)
Definition Reaction.hh:134
void SetA(int myA)
Definition Reaction.hh:131
double GetBeta()
Definition Reaction.hh:99
double GetEnergyCoM()
Definition Reaction.hh:112
std::string GetIsotope()
Definition Reaction.hh:94
double ECoM
energy in the Center-of-Mass system
Definition Reaction.hh:149
int Z
The Z of the particle, obviously.
Definition Reaction.hh:146
double Elab
energy in the laboratory system
Definition Reaction.hh:148
void SetEnergyCoM(double myECoM)
Definition Reaction.hh:135
double Phi
phi in the laboratory system in radians
Definition Reaction.hh:153
double Theta
theta in the laboratory system in radians
Definition Reaction.hh:151
double GetParticleZ(std::shared_ptr< ParticleEvt > p)
Definition Reaction.hh:251
bool HistIonChamber()
Definition Reaction.hh:547
std::vector< double > cd_dist
distance from target to CD detector in mm
Definition Reaction.hh:618
TVector3 GetCDVector(unsigned char det, unsigned char sec, float pid, float nid)
Definition Reaction.cc:451
std::vector< double > mb_r
Definition Reaction.hh:624
double GetElectronTheta(unsigned char seg)
Definition Reaction.hh:307
double GetParticleX(unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid)
Definition Reaction.hh:224
double GetGammaGammaRandomTime(unsigned char i)
Definition Reaction.hh:415
double GetParticleTheta(std::shared_ptr< ParticleEvt > p)
Definition Reaction.hh:239
double GetEBISTimeRatio()
Definition Reaction.hh:384
TVector3 GetElectronVector(unsigned char seg)
Definition Reaction.cc:608
double GetParticleParticlePromptTime(unsigned char i)
Definition Reaction.hh:426
bool EventsGammaSegmentEnergy()
Definition Reaction.hh:530
double GetGammaPhi(unsigned char clu, unsigned char cry, unsigned char seg)
Definition Reaction.hh:274
double GetParticleElectronTimeRatio()
Definition Reaction.hh:484
double GetEnergyPrime()
Definition Reaction.hh:362
double EBIS_On
beam on max time in ns
Definition Reaction.hh:583
std::string transfercutname
Definition Reaction.hh:676
double spede_offset
phi rotation of the SPEDE detector
Definition Reaction.hh:629
double GetMiniballAlpha(unsigned char clu)
Definition Reaction.hh:265
double GetParticleElectronPromptTime(unsigned char i)
Definition Reaction.hh:474
double y_offset
vertical offset of the target/beam position, with respect to the CD and Miniball in mm
Definition Reaction.hh:610
bool HistElectron()
Definition Reaction.hh:544
double GetTau()
Definition Reaction.hh:359
double GetGammaGammaPromptTime(unsigned char i)
Definition Reaction.hh:410
MiniballParticle Ejectile
Definition Reaction.hh:573
bool IsEjectileDetected()
Definition Reaction.hh:522
double GetSpedeDistance()
Definition Reaction.hh:303
TVector3 GetParticleVector(std::shared_ptr< ParticleEvt > p)
Definition Reaction.hh:236
double GetElectronTheta(SpedeEvt *s)
Definition Reaction.hh:310
std::vector< double > mb_alpha
Definition Reaction.hh:624
void IdentifyRecoil(std::shared_ptr< ParticleEvt > p, bool kinflag=false)
Definition Reaction.cc:895
std::vector< std::unique_ptr< TGraph > > gStopping
Definition Reaction.hh:684
double GetParticleGammaRandomTime(unsigned char i)
Definition Reaction.hh:399
double x_offset
horizontal offset of the target/beam position, with respect to the CD and Miniball in mm
Definition Reaction.hh:609
std::string GetTransferX()
Definition Reaction.hh:505
int pe_prompt[2]
particle-electron prompt
Definition Reaction.hh:602
bool HistWithoutAddback()
Definition Reaction.hh:536
bool HistElectronGamma()
Definition Reaction.hh:545
std::shared_ptr< TCutG > GetTransferCut()
Definition Reaction.hh:504
std::shared_ptr< TCutG > recoil_cut
Definition Reaction.hh:680
double GetGammaY(std::shared_ptr< GammaRayEvt > g)
Definition Reaction.hh:295
MiniballParticle * GetTarget()
Definition Reaction.hh:510
std::vector< double > mb_theta
Definition Reaction.hh:624
std::string ejectilecutfile
Definition Reaction.hh:674
TVector3 GetSpedeVector(unsigned char seg, bool random=false)
Definition Reaction.cc:580
int pp_prompt[2]
particle-particle prompt
Definition Reaction.hh:596
double events_gamma_seg_ediff
Definition Reaction.hh:650
double GetParticleElectronFillRatio()
Definition Reaction.hh:487
bool EventsGammaDemandSegment()
Definition Reaction.hh:531
double GetGammaX(std::shared_ptr< GammaRayEvt > g)
Definition Reaction.hh:292
std::shared_ptr< TCutG > GetEjectileCut()
Definition Reaction.hh:502
std::string degrader_material
can be an isotope name, or some string that matches the material used and corresponding SRIM file
Definition Reaction.hh:615
double GetElectronPhi(SpedeEvt *s)
Definition Reaction.hh:316
ClassDef(MiniballReaction, 3) private std::shared_ptr< MiniballSettings > set
Definition Reaction.hh:560
int gg_random[2]
gamma-gamma random
Definition Reaction.hh:595
double GetBetaCoM()
Definition Reaction.hh:350
double EBIS_Off
beam off max time in ns
Definition Reaction.hh:584
bool EventsCdPadVeto()
Definition Reaction.hh:529
std::string transfercutfile
Definition Reaction.hh:676
bool HistSegmentPhi()
Definition Reaction.hh:538
void ReadReaction()
Definition Reaction.cc:108
double GetGammaPhi(std::shared_ptr< GammaRayEvt > g)
Definition Reaction.hh:289
double GetEnergyTotLab()
Definition Reaction.hh:337
void SetFile(std::string filename)
Definition Reaction.hh:176
double GetGammaElectronFillRatio()
Definition Reaction.hh:455
MiniballParticle * GetRecoil()
Definition Reaction.hh:512
unsigned int HistParticleBins()
Definition Reaction.hh:556
double GetParticleGammaTimeRatio()
Definition Reaction.hh:404
std::shared_ptr< TCutG > GetRecoilCut()
Definition Reaction.hh:503
TVector3 GetCDVector(std::shared_ptr< ParticleEvt > p)
Definition Reaction.hh:233
std::shared_ptr< TCutG > ejectile_cut
Definition Reaction.hh:679
double GetParticleGammaPromptTime(unsigned char i)
Definition Reaction.hh:394
double DopplerCorrection(double gen, double gth, double gph, double pbeta, double ptheta, double pphi)
Definition Reaction.cc:669
double GetGammaElectronRandomTime(unsigned char i)
Definition Reaction.hh:447
unsigned int events_gamma_max_seg_mult
Definition Reaction.hh:649
const std::string InputFile()
Definition Reaction.hh:179
double HistElectronMin()
Definition Reaction.hh:554
double GetGammaY(unsigned char clu, unsigned char cry, unsigned char seg)
Definition Reaction.hh:280
double HistParticleMin()
Definition Reaction.hh:557
double GetEnergyTotCM()
Definition Reaction.hh:340
double z_offset
lateral offset of the target/beam position, with respect to the only Miniball in mm (cd_dist is indep...
Definition Reaction.hh:611
double GetElectronPhi(unsigned char seg)
Definition Reaction.hh:313
void PrintReaction(std::ostream &stream, std::string opt)
Definition Reaction.cc:397
int gg_prompt[2]
gamma-gamma prompt
Definition Reaction.hh:594
double Eb
laboratory beam energy in keV/u
Definition Reaction.hh:580
double GetGammaTheta(unsigned char clu, unsigned char cry, unsigned char seg)
Definition Reaction.hh:271
bool events_gamma_seg_energy
Definition Reaction.hh:647
std::string ejectilecutname
Definition Reaction.hh:674
double GetMiniballTheta(unsigned char clu)
Definition Reaction.hh:259
double GetGammaCoM()
Definition Reaction.hh:356
double GetParticleX(std::shared_ptr< ParticleEvt > p)
Definition Reaction.hh:245
void SetParticleTime(unsigned long long t)
Definition Reaction.hh:521
double GetParticleParticleFillRatio()
Definition Reaction.hh:439
void AddBindingEnergy(short Ai, short Zi, TString ame_be_str)
Definition Reaction.cc:20
double HistGammaMin()
Definition Reaction.hh:551
unsigned int particle_bins
Definition Reaction.hh:667
int ge_prompt[2]
gamma-electron prompt
Definition Reaction.hh:598
MiniballReaction(std::string filename, std::shared_ptr< MiniballSettings > myset)
double GetParticleElectronRandomTime(unsigned char i)
Definition Reaction.hh:479
double GetGammaTheta(std::shared_ptr< GammaRayEvt > g)
Definition Reaction.hh:286
std::vector< double > mb_phi
Definition Reaction.hh:624
double GetEBISOnTime()
Definition Reaction.hh:382
double GetParticleZ(unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid)
Definition Reaction.hh:230
std::string transfercut_x
Definition Reaction.hh:677
std::string recoilcutname
Definition Reaction.hh:675
std::vector< MiniballGeometry > mb_geo
Definition Reaction.hh:623
bool HistBeamDump()
Definition Reaction.hh:546
double GetParticleTheta(unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid)
Definition Reaction.hh:218
MiniballParticle Beam
Definition Reaction.hh:573
double EBIS_ratio
ratio of ebis on/off as measured
Definition Reaction.hh:585
double ee_ratio
fill ratios
Definition Reaction.hh:605
double GetParticleParticleRandomTime(unsigned char i)
Definition Reaction.hh:431
double t1_time[2]
event time - T1 cut window
Definition Reaction.hh:589
double GetBeta()
Definition Reaction.hh:347
double gamma_range[2]
Definition Reaction.hh:668
double target_thickness
target thickness in units of mg/cm^2
Definition Reaction.hh:608
std::shared_ptr< TCutG > transfer_cut
Definition Reaction.hh:681
std::string transfercut_y
Definition Reaction.hh:677
bool events_particle_gamma
Definition Reaction.hh:644
unsigned char GetLaserMode()
Definition Reaction.hh:187
int pe_random[2]
particle-electron random
Definition Reaction.hh:603
MiniballParticle Target
Definition Reaction.hh:573
TVector3 GetParticleVector(unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid)
Definition Reaction.cc:561
MiniballParticle Recoil
Definition Reaction.hh:573
double GetGammaElectronTimeRatio()
Definition Reaction.hh:452
double GetElectronElectronFillRatio()
Definition Reaction.hh:471
double GetOffsetX()
Definition Reaction.hh:497
bool HistByCrystal()
Definition Reaction.hh:539
double degrader_thickness
target thickness in units of mg/cm^2. Negative if degrader not present. SHM, RAB 12 June 2025
Definition Reaction.hh:614
double GetSpedePhiOffset()
Definition Reaction.hh:304
std::vector< double > GetParticleThetas()
Definition Reaction.hh:205
std::vector< double > cd_offset
phi rotation of the CD in degrees
Definition Reaction.hh:619
void ReadMassTables()
Definition Reaction.cc:42
double CosTheta(std::shared_ptr< GammaRayEvt > g, bool ejectile)
Definition Reaction.cc:623
MiniballParticle * GetBeam()
Definition Reaction.hh:509
double GetGamma()
Definition Reaction.hh:353
unsigned int electron_bins
Definition Reaction.hh:667
unsigned int GetNumberOfParticleThetas()
Definition Reaction.hh:202
bool HistGammaGamma()
Definition Reaction.hh:543
double GetParticlePhi(std::shared_ptr< ParticleEvt > p)
Definition Reaction.hh:242
double GetGammaZ(unsigned char clu, unsigned char cry, unsigned char seg)
Definition Reaction.hh:283
bool hist_electron_gamma
Definition Reaction.hh:662
bool ReadStoppingPowers(std::string isotope1, std::string isotope2, std::unique_ptr< TGraph > &g)
Definition Reaction.cc:1207
double GetGammaElectronPromptTime(unsigned char i)
Definition Reaction.hh:442
MiniballParticle * GetEjectile()
Definition Reaction.hh:511
double GetMiniballR(unsigned char clu)
Definition Reaction.hh:268
double GetParticleY(unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid)
Definition Reaction.hh:227
double GetMiniballPhi(unsigned char clu)
Definition Reaction.hh:262
int pg_prompt[2]
particle-gamma prompt
Definition Reaction.hh:592
void TransferProduct(std::shared_ptr< ParticleEvt > p, bool kinflag=false)
Definition Reaction.cc:1070
void ResetParticles()
Definition Reaction.hh:516
unsigned long long particle_time
Definition Reaction.hh:576
double GetGammaGammaTimeRatio()
Definition Reaction.hh:420
double GetEpsilon()
Definition Reaction.hh:365
int ee_random[2]
electron-electron random
Definition Reaction.hh:601
double electron_range[2]
Definition Reaction.hh:668
double pp_ratio
fill ratios
Definition Reaction.hh:604
double GetT1MaxTime()
Definition Reaction.hh:391
int ge_random[2]
gamma-electron random
Definition Reaction.hh:599
bool IsRecoilDetected()
Definition Reaction.hh:523
double GetCDDeadLayer(unsigned char det)
Definition Reaction.hh:198
double spede_dist
distance from target to SPEDE detector
Definition Reaction.hh:628
unsigned int HistElectronBins()
Definition Reaction.hh:553
bool events_particle_cdpad_coinc
Definition Reaction.hh:645
TVector3 GetCDVector(unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid)
Definition Reaction.hh:214
unsigned int HistGammaBins()
Definition Reaction.hh:550
void SetupCluster(unsigned char clu, double user_theta, double user_phi, double user_alpha, double user_r, double user_z)
Definition Reaction.hh:256
bool EventsParticleGammaOnly()
Definition Reaction.hh:527
void CalculateRecoil()
Definition Reaction.cc:1025
double GetT1MinTime()
Definition Reaction.hh:390
void IdentifyEjectile(std::shared_ptr< ParticleEvt > p, bool kinflag=false)
Definition Reaction.cc:796
double GetGammaX(unsigned char clu, unsigned char cry, unsigned char seg)
Definition Reaction.hh:277
bool EventsCdPadCoincidence()
Definition Reaction.hh:528
double HistParticleMax()
Definition Reaction.hh:558
double GetCDDistance(unsigned char det)
Definition Reaction.hh:190
unsigned int EventsGammaMaxSegmentMultiplicity()
Definition Reaction.hh:532
unsigned int gamma_bins
Definition Reaction.hh:667
double GetQvalue()
Definition Reaction.hh:333
double GetElectronElectronTimeRatio()
Definition Reaction.hh:468
double HistElectronMax()
Definition Reaction.hh:555
unsigned char GetDopplerMode()
Definition Reaction.hh:184
double GetParticlePhi(unsigned char det, unsigned char sec, unsigned char pid, unsigned char nid)
Definition Reaction.hh:221
unsigned char doppler_mode
Definition Reaction.hh:631
void CalculateEjectile()
Definition Reaction.cc:980
double GetOffsetY()
Definition Reaction.hh:498
double GetGammaGammaFillRatio()
Definition Reaction.hh:423
double GetOffsetZ()
Definition Reaction.hh:499
std::shared_ptr< TCutG > ReadCutFile(std::string cut_filename, std::string cut_name)
Definition Reaction.cc:418
bool events_gamma_demand_seg
Definition Reaction.hh:648
double GetEBISOffTime()
Definition Reaction.hh:383
double HistGammaMax()
Definition Reaction.hh:552
double GetEnergyLoss(double Ei, double dist, std::unique_ptr< TGraph > &g)
Definition Reaction.cc:1182
unsigned char mb_type
Definition Reaction.hh:625
double GetParticleParticleTimeRatio()
Definition Reaction.hh:436
std::vector< double > dead_layer
dead layer thickness in mm
Definition Reaction.hh:620
bool HistBySector()
Definition Reaction.hh:541
double particle_range[2]
Definition Reaction.hh:668
std::map< std::string, double > ame_be
List of biniding energies from AME2021.
Definition Reaction.hh:570
std::string recoilcutfile
Definition Reaction.hh:675
bool HistByMultiplicity()
Definition Reaction.hh:540
int pp_random[2]
particle-particle random
Definition Reaction.hh:597
double EventsGammaCoreSegmentEnergyDifference()
Definition Reaction.hh:533
bool t1_cut
enable/disable T1 cuts on data
Definition Reaction.hh:588
unsigned char laser_mode
Definition Reaction.hh:640
double GetParticleGammaFillRatio()
Definition Reaction.hh:407
double GetCDPhiOffset(unsigned char det)
Definition Reaction.hh:194
double GetGammaZ(std::shared_ptr< GammaRayEvt > g)
Definition Reaction.hh:298
int ee_prompt[2]
electron-electron prompt
Definition Reaction.hh:600
int pg_random[2]
particle-gamma random
Definition Reaction.hh:593
double GetParticleY(std::shared_ptr< ParticleEvt > p)
Definition Reaction.hh:248
bool HistWithAddback()
Definition Reaction.hh:537
double DopplerShift(double gen, double pbeta, double costheta)
Definition Reaction.cc:658
double GetEBISFillRatio()
Definition Reaction.hh:385
bool events_particle_cdpad_veto
Definition Reaction.hh:646
unsigned long long GetParticleTime()
Definition Reaction.hh:515
bool IsTransferDetected()
Definition Reaction.hh:524
double GetElectronElectronPromptTime(unsigned char i)
Definition Reaction.hh:458
std::string GetTransferY()
Definition Reaction.hh:506
double GetElectronElectronRandomTime(unsigned char i)
Definition Reaction.hh:463
unsigned char GetSegment()
std::shared_ptr< MiniballSettings > myset
Definition mb_sort.cc:123