123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338 |
- #include "StFemtoTrack.h"
- #include "TMath.h"
- ClassImp(StFemtoTrack)
- //_________________
- StFemtoTrack::StFemtoTrack() {
- mId = -999;
- mNSigmaElectron = -999;
- mNSigmaPion = -999;
- mNSigmaKaon = -999;
- mNSigmaProton = -999;
- mDedx = 0;
- mMomX = 0.;
- mMomY = 0.;
- mMomZ = 0.;
- mBeta = -999.;
- }
- //_________________
- StFemtoTrack::StFemtoTrack(Float_t px, Float_t py, Float_t pz) {
- mId = -999;
- mNSigmaElectron = -999;
- mNSigmaPion = -999;
- mNSigmaKaon = -999;
- mNSigmaProton = -999;
- mDedx = 0;
- mMomX = px;
- mMomY = py;
- mMomZ = pz;
- mBeta = -999.;
- }
- //_________________
- StFemtoTrack::~StFemtoTrack() {
- /* nothing to do*/
- }
- //_________________
- Short_t StFemtoTrack::GetType() const {
- if( (mMomX <= 1e-5) &&
- (mMomY <= 1e-5) &&
- (mMomZ <= 1e-5) ) {
- return 0; //Global
- }
- else {
- return 1; //Primary
- }
- }
- //_________________
- Bool_t StFemtoTrack::GetIsTofTrack() {
- if(mBeta < -1.) {
- return false;
- }
- else {
- return true;
- }
- }
- //_________________
- void StFemtoTrack::SetP(Float_t px, Float_t py, Float_t pz) {
- mMomX = px;
- mMomY = py;
- mMomZ = pz;
- }
- //_________________
- TVector3 StFemtoTrack::GetP() const {
- TVector3 p(mMomX, mMomY, mMomZ);
- return p;
- }
- //_________________
- Float_t StFemtoTrack::GetPt() const {
- return TMath::Sqrt(mMomX*mMomX + mMomY*mMomY);
- }
- //_________________
- Float_t StFemtoTrack::GetPtot() const {
- return TMath::Sqrt(mMomX*mMomX + mMomY*mMomY + mMomZ*mMomZ);
- }
- //_________________
- Float_t StFemtoTrack::GetEta() const {
- float ptot = TMath::Sqrt(mMomX*mMomX + mMomY*mMomY + mMomZ*mMomZ);
- float eta = 0.5*TMath::Log( (ptot + mMomZ) / (ptot - mMomZ) );
- return eta;
- }
- //_________________
- void StFemtoTrack::SetGlobalP(Float_t px, Float_t py, Float_t pz) {
- mGlobMomX = px;
- mGlobMomY = py;
- mGlobMomZ = pz;
- }
- //_________________
- UShort_t StFemtoTrack::GetNHitsFit() const {
-
- if(StFemtoTrack::GetType() == 1) {
- return (TMath::Abs(mNHits)+1);
- }
- else {
- return TMath::Abs(mNHits);
- }
- }
- //_________________
- TVector3 StFemtoTrack::GetGlobalP() const {
-
- TVector3 p( mGlobMomX, mGlobMomY, mGlobMomZ );
- return p;
- }
- //_________________
- Float_t StFemtoTrack::GetPtGlobal() const {
- return TMath::Sqrt(mGlobMomX*mGlobMomX + mGlobMomY*mGlobMomY);
- }
- //_________________
- Float_t StFemtoTrack::GetPtotGlobal() const {
- return TMath::Sqrt(mGlobMomX*mGlobMomX + mGlobMomY*mGlobMomY + mGlobMomZ*mGlobMomZ);
- }
- //_________________
- Float_t StFemtoTrack::GetMassSqr() const {
- float mSqr = -999.;
- if(mBeta > 0.) {
- float ptot = TMath::Sqrt(mMomX*mMomX + mMomY*mMomY + mMomZ*mMomZ);
- mSqr = ptot*ptot * (1./(mBeta*mBeta) - 1.);
- }
- return mSqr;
- }
- //_________________
- void StFemtoTrack::SetNSigmaElectron(Float_t ns) {
- if(TMath::Abs(ns*1000) >= SHORTMAX) {
- if(ns>0) {
- mNSigmaElectron = SHORTMAX;
- }
- else {
- mNSigmaElectron = -SHORTMAX;
- }
- }
- else {
- mNSigmaElectron = (Short_t)(ns*1000);
- }
- }
- //_________________
- void StFemtoTrack::SetNSigmaPion(Float_t ns) {
- if(TMath::Abs(ns*1000) >= SHORTMAX) {
- if(ns>0) {
- mNSigmaPion = SHORTMAX;
- }
- else {
- mNSigmaPion = -SHORTMAX;
- }
- }
- else {
- mNSigmaPion = (Short_t)(ns*1000);
- }
- }
- //_________________
- void StFemtoTrack::SetNSigmaKaon(Float_t ns) {
- if(TMath::Abs(ns*1000) >= SHORTMAX) {
- if(ns>0) {
- mNSigmaKaon = SHORTMAX;
- }
- else {
- mNSigmaKaon = -SHORTMAX;
- }
- }
- else {
- mNSigmaKaon = (Short_t)(ns*1000);
- }
- }
- //_________________
- void StFemtoTrack::SetNSigmaProton(Float_t ns) {
- if(TMath::Abs(ns*1000) >= SHORTMAX) {
- if(ns>0) {
- mNSigmaProton = SHORTMAX;
- }
- else {
- mNSigmaProton = -SHORTMAX;
- }
- }
- else {
- mNSigmaProton = (Short_t)(ns*1000);
- }
- }
- //_________________
- void StFemtoTrack::SetDCAxGlobal(Float_t x) {
- if(TMath::Abs(x*10000) >= SHORTMAX) {
- if(x>0) {
- mDCAxGlobal = SHORTMAX;
- }
- else {
- mDCAxGlobal = -SHORTMAX;
- }
- }
- else {
- mDCAxGlobal = (Short_t)(x * 10000);
- }
- }
- //_________________
- void StFemtoTrack::SetDCAyGlobal(Float_t y) {
- if(TMath::Abs(y*10000) >= SHORTMAX) {
- if(y>0) {
- mDCAyGlobal = SHORTMAX;
- }
- else {
- mDCAyGlobal = -SHORTMAX;
- }
- }
- else {
- mDCAyGlobal = (Short_t)(y * 10000);
- }
- }
- //_________________
- void StFemtoTrack::SetDCAzGlobal(Float_t z) {
- if(TMath::Abs(z*10000) >= SHORTMAX) {
- if(z>0) {
- mDCAzGlobal = SHORTMAX;
- }
- else {
- mDCAzGlobal = -SHORTMAX;
- }
- }
- else {
- mDCAzGlobal = (Short_t)(z * 10000);
- }
- }
- //_________________
- void StFemtoTrack::SetDCAGlobal(Float_t x, Float_t y, Float_t z) {
- if(TMath::Abs(x*10000) >= SHORTMAX) {
- if(x>0) {
- mDCAxGlobal = SHORTMAX;
- }
- else {
- mDCAxGlobal = -SHORTMAX;
- }
- }
- else {
- mDCAxGlobal = (Short_t)(x * 10000);
- }
- if(TMath::Abs(y*10000) >= SHORTMAX) {
- if(y>0) {
- mDCAyGlobal = SHORTMAX;
- }
- else {
- mDCAyGlobal = -SHORTMAX;
- }
- }
- else {
- mDCAyGlobal = (Short_t)(y * 10000);
- }
- if(TMath::Abs(z*10000) >= SHORTMAX) {
- if(z>0) {
- mDCAzGlobal = SHORTMAX;
- }
- else {
- mDCAzGlobal = -SHORTMAX;
- }
- }
- else {
- mDCAzGlobal = (Short_t)(z * 10000);
- }
- }
- //_________________
- void StFemtoTrack::SetDedx(Float_t dEdx) {
- if(dEdx >= USHORTMAX) {
- mDedx = USHORTMAX;
- }
- else {
- mDedx = (UShort_t)(dEdx * 1e9);
- }
- }
- //_________________
- void StFemtoTrack::SetDedx(Double_t dEdx) {
- if(dEdx >= USHORTMAX) {
- mDedx = USHORTMAX;
- }
- else {
- mDedx = (UShort_t)(dEdx * 1e9);
- }
- }
- //_________________
- Float_t StFemtoTrack::GetDCAxyGlobal() const {
- Float_t x = (Float_t)mDCAxGlobal * 0.0001;
- Float_t y = (Float_t)mDCAyGlobal * 0.0001;
- return TMath::Sqrt(x*x + y*y);
- }
- //_________________
- Float_t StFemtoTrack::GetDCAGlobal() const {
- Float_t x = (Float_t)mDCAxGlobal * 0.0001;
- Float_t y = (Float_t)mDCAyGlobal * 0.0001;
- Float_t z = (Float_t)mDCAzGlobal * 0.0001;
- return TMath::Sqrt(x*x + y*y + z*z);
- }
|