BeReaction.h 4.69 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
/*
 * BeReaction.h
 *
 *  Created on: 24.5.2010
 *      Author: Vratislav
 */

//#ifndef BEREACTION_H_
//#define BEREACTION_H_

#pragma once
//#include "DllExport.h"
#include <TObject.h>
#include <TROOT.h>
#include <TRandom3.h>
#include <TF1.h>
#include <TString.h>
#include <TMath.h>
#include <TVector3.h>
#include <TLorentzVector.h>
#include <TLorentzRotation.h>


#include <iostream>		//k nicemu
#include <fstream>		//k nicemu
#include <iomanip>		//k nicemu
#include <sstream>		//k nicemu
//#include <string>

#include "BinaryReaction.h"

//#define	PARAMETERFILE "sim.par"

using std::cout;
using std::endl;
//using std::string;
//using std::getline;

class BeReaction {
//private:
public:
											//1 + 2 --> a + b
	BinaryReaction		fLip;				//6Li + p --> 6Be + n
	BinaryReaction		fBeDecay;			//6Be --> 2p + 4He
	BinaryReaction		fDipDecay;			//2p --> p + p
	Int_t	fcorrect;


	//neni dobre, ze jsou static
	static	Double_t	LipM[4];			//!	{E_6Li; E_proton; E_6Be; E_neutron}
	static	Double_t	BeDecayM[4];		//!	{E_6Be_g.s.; 0; E_diproton; E_4He}
	static	Double_t	BeStateEnergy[6];	//!	{E_g.s. = 0; Gamma_g.s.; E_e.s.; Gamma_e.s.; population ratio; 4He2p threshold}
	static	Double_t	DipDecayM[4];		//!	{E_diproton; 0; proton; proton}
//	static	TRandom3	ranTheta;
	static	TRandom3	ranMass;			//!
	static	TRandom3	ranTheta;			//!
	static	TF1			theta;				//!
	static	TF1			thetaUniform;		//!
	static	TF1			dipEnergy;			//!	phase volume

public:
	BeReaction();
	virtual ~BeReaction();

	ClassDef(BeReaction, 1);

	void FillProcess(Double_t _LiT, Double_t _LiThetaIn, Double_t _LiPhi);
	//using generator
	void FillProcess(Double_t _LiT, Double_t _LiThetaIn, Double_t _LiPhi,
			Double_t *_p_alpha, Double_t *_p_p1, Double_t *_p_p2,
			Double_t _thetaCM);
	void FillProcess(Double_t _LiT, Double_t _LiThetaIn, Double_t _LiPhi,
			Double_t *_p_alpha, Double_t *_p_p1, Double_t *_p_p2,
			Double_t _thetaCMmin, Double_t _thetaCMmax);

//	void ReadParameters();
	void ReadParameters(const char *parameterfile = "sim.par");
	void PrintParameters();
	void Reset();

	Double_t ThetaCMdistr(Double_t tmin, Double_t tmax) const;
	Double_t ThetaCMdistrUniform(Double_t tmin, Double_t tmax) const;
	Double_t ThetaCMdistrDiscrete() const;
	void	SetLipMasses(Double_t _lpm[]);
	void	SetLipMasses_uniformBeMass(Double_t _lpm[]);
	void	SetLipMasses_discreteBeMass(Double_t _lpm[]);
	void	SetBeDecayMasses(Double_t _bdm[]);
	void	SetDipDecayMasses(Double_t _2pm[]);

	//getters in laboratory system
		//alpha
	Double_t GetAlphaT() const { return fBeDecay.GetTb(); };
	Double_t GetAlphaTheta() const { return fBeDecay.GetThetaB(); };
	Double_t GetAlphaPhi() const { return fBeDecay.GetPhiB(); };
//	TVector3* GetAlphaP();
	TVector3 GetAlphaP();
	TLorentzVector GetAlpha();
		//first proton (higher T)
	Double_t GetP1T() const { return (fDipDecay.GetTa() >= fDipDecay.GetTb()) ? fDipDecay.GetTa() : fDipDecay.GetTb(); };
	Double_t GetP1Theta() const { return (fDipDecay.GetTa() >= fDipDecay.GetTb()) ? fDipDecay.GetThetaA() : fDipDecay.GetThetaB(); };
	Double_t GetP1Phi() const { return (fDipDecay.GetTa() >= fDipDecay.GetTb()) ? fDipDecay.GetPhiA() : fDipDecay.GetPhiB(); };
	TVector3 GetP1P();
	TLorentzVector GetP1();
		//second proton (lower T)
	Double_t GetP2T() const { return (fDipDecay.GetTa() <= fDipDecay.GetTb()) ? fDipDecay.GetTa() : fDipDecay.GetTb(); };
	Double_t GetP2Theta() const { return (fDipDecay.GetTa() <= fDipDecay.GetTb()) ? fDipDecay.GetThetaA() : fDipDecay.GetThetaB(); };
	Double_t GetP2Phi() const { return (fDipDecay.GetTa() <= fDipDecay.GetTb()) ? fDipDecay.GetPhiA() : fDipDecay.GetPhiB(); };
	TVector3 GetP2P();
	TLorentzVector GetP2();
		//neutron
	Double_t GetNeutronT() const { return fLip.GetTb(); };
	Double_t GetNeutronTheta() const { return fLip.GetThetaB(); };
	Double_t GetNeutronPhi() const { return fLip.GetPhiB(); };
//	TVector3* GetNeutronP();
	TVector3 GetNeutronP();
	TLorentzVector GetNeutron();
		//6Be
	Double_t GetBeT() const { return fLip.GetTa(); };
	Double_t GetBeTheta() const { return fLip.GetThetaA(); };
	Double_t GetBePhi() const { return fLip.GetPhiA(); };
	TVector3 GetBeP();
	TLorentzVector GetBe();

	//getters
	BinaryReaction* GetLip() { return &fLip; };
	BinaryReaction* GetBeDecay() { return &fBeDecay; };
	BinaryReaction* GetDipDecay() { return &fDipDecay; };



	//diagnostics
	UInt_t GetMSeed() const { return ranMass.GetSeed(); };
//	UInt_t GetTSeed() const { return ranTheta.GetSeed(); };
	UInt_t GetLipPhiSeed() const { return fLip.GetPSeed(); };
	UInt_t GetBePhiSeed() const { return fBeDecay.GetPSeed(); };
	UInt_t GetDipPhiSeed() const { return fDipDecay.GetPSeed(); };

	//physics
	Double_t	T(Double_t pc2, Double_t mc2);			//v podstate taktez
	Double_t	E(Double_t pc2, Double_t mc2);			//v podstate taktez

};

//#endif /* BEREACTION_H_ */