// // // This class enables you to set mass and impulse of particle, // change values and get them back // #ifndef __PARTICLE_H__ #define __PARTICLE_H__ #include "TLorentzVector.h" #include #include "TMath.h" #include "TString.h" #include "TTree.h" #include "TH1I.h" #include "TF1.h" #include "../Utilities/ConfigDictionary.h" using std::cout; using std::endl; using TMath::Sqrt; using TMath::Power; /////////////////////////////////////////////////////////////////////////////// // ExcitationState - minor class helpful to hold information // of excited state of particle in one place. // It consists of four data fields: // fMean - mean value of energy state // fWidth - width of energy state // fShape - type of function modelling state shape // fStrength - unitless, not normalized number telling // how probable comparing to other this state is. ////////////////////////////////////////////////////////////////////////////// class ExcitationState { //Excitation state class represents single distribution //of mass of the excited particle. //Implemented only standard, most useful functions. public: ExcitationState(); ExcitationState(Double_t mean, Double_t width, TString shape, Int_t strength); TString CreateConfigString(); int ReadConfigString(TString cs); Double_t GetMean(){return fMean;}; Double_t GetWidth(){return fWidth;}; TString GetShape(){return fShape;}; Int_t GetStrength(){return fStrength;}; private: Double_t fMean; Double_t fWidth; TString fShape; Int_t fStrength; }; class Particle: public TNamed { private: //Particle owns excitation states array: std::vector fExcitationStates; //!array of excitation states of particle //This static field is used to count created particles instances. //With that we can make sure everyone has it's own unique name based on //string representation of its number. Most useful in Gui. static Int_t numberOfParticles; //number of all created particles Double_t fMass; //rest-mass Double_t fGroundStateMass; //it is necessary for excited states TLorentzVector fImpulse; //Lorentz four-vector of momentum //Z & A numbers Int_t fZ; //Z num. default 0 Int_t fA; //A num. default 0 Bool_t fObservable; //whether particle can be registered // TString fName; //mass spectrum std::vector fState; //! TH1I fStatesWeigths; //! void CreateStatesWeigthsHist(); // Checks energy conservation Bool_t CheckEnergyConservation(); // Kinetic energy function Double_t CalcT(Double_t m, Double_t px, Double_t py, Double_t pz); // Impulse function Double_t CalcP(Double_t m, Double_t T); public: Particle(); Particle(const char *name, Double_t mass, Int_t A, Int_t Z, Bool_t obs); Particle(TString cs); virtual ~Particle(); ClassDef(Particle, 1); //Excitation states: void AddExcitationState(ExcitationState exstate); void ClearExcitationStates(); Int_t GetNumberOfExStates(); ExcitationState GetExcitationState(Int_t index); //mass spectrum void CreateStateMassFunctions(); void GenerateMass(); void DrawWeigths(); void DrawMassDistribution(Int_t i, Option_t *option = ""); // Particle(const Particle &) {}; // Set mass and impulse of particle at zero value void Reset(); int CopyValues(Particle * other); void SetMPxPyPz(Double_t m, Double_t px, Double_t py, Double_t pz); void SetMTNxNyNz(Double_t m, Double_t T, Double_t nx, Double_t ny, Double_t nz); // Set mass, kinetic energy and direction vector (Nx,Ny,Nz) void SetMTDir(Double_t m, Double_t T, TVector3 dir); // void SetMass(Double_t mass); void SetE(Double_t E); // Cartesian x coordinate of impulse void SetPx(Double_t px); // Cartesian y coordinate of impulse void SetPy(Double_t py); // Cartesian z coordinate of impulse void SetPz(Double_t pz); void SetObservable(Bool_t obs); void SetMass(Double_t mass); void SetP(TVector3 P); void SetT(Double_t T); // void SetPhiTheta(Double_t phi, Double_t theta); void SetTPhiTheta(Double_t T, Double_t phi, Double_t theta); void BoostTransform(TVector3 beta); void SetImpulse(TLorentzVector *P); // Get rest-mass value Double_t GetM() { return fMass; }; Double_t GetMgs() { return fGroundStateMass; }; // Get energy value Double_t GetE() { return fImpulse.Energy(); }; // Get value of x coordinate of impulse Double_t GetPx() { return fImpulse.Px(); }; // Get value of y coordinate of impulse Double_t GetPy() { return fImpulse.Py(); }; // Get value of z coordinate of impulse Double_t GetPz() { return fImpulse.Pz(); }; // Get value of radial distance of impulse Double_t GetP() { return fImpulse.Rho(); }; // Get value of azimuthal angle of impulse Double_t GetPhi() { return fImpulse.Phi(); }; // Get value of polar angle of impulse Double_t GetTheta() { return fImpulse.Theta(); }; //whether object is observable or not Bool_t IsObservable(); //get kinetic energy Double_t GetT() { return fImpulse.E() - fMass; }; //Get vector beta TVector3 GetBoost(); //Get impulse components TLorentzVector Get4Vector() { return fImpulse; } //Set A & Z of particle void SetAZ(Int_t A, Int_t Z) { fA = A; fZ = Z; }; void SetA(Int_t A) { fA = A; }; void SetZ(Int_t Z) { fZ = Z; }; TString CreateConfigString(); void ReadConfigString(TString); //Get A number Int_t GetA() { return fA; }; //Get Z number Int_t GetZ() { return fZ; }; Double_t CalcE(); virtual void Print(Option_t * option=0); }; #endif