// ------------------------------------------------------------------------- // ----- KrakowArrayPoint source file ----- // ------------------------------------------------------------------------- #include "KrakowArrayPoint.h" #include using std::cout; using std::endl; using std::flush; // ----- Default constructor ------------------------------------------- KrakowArrayPoint::KrakowArrayPoint() : FairMCPoint() { fX_out = fY_out = fZ_out = 0.; fPx_out = fPy_out = fPz_out = 0.; fLightYield = fSlow = -1 ; ///Make sure if better will be 0 as defalut value } // ------------------------------------------------------------------------- // ----- Standard constructor ------------------------------------------ KrakowArrayPoint::KrakowArrayPoint(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t tof, Double_t length, Double_t eLoss, Double_t lightYield, Double_t slow) : FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss) { fX_out = posOut.X(); fY_out = posOut.Y(); fZ_out = posOut.Z(); fPx_out = momOut.Px(); fPy_out = momOut.Py(); fPz_out = momOut.Pz(); fLightYield = lightYield; fSlow = slow; } // ------------------------------------------------------------------------- // ----- Destructor ---------------------------------------------------- KrakowArrayPoint::~KrakowArrayPoint() { } // ------------------------------------------------------------------------- // ----- Public method Print ------------------------------------------- void KrakowArrayPoint::Print(const Option_t* opt) const { cout << "-I- KrakowArrayPoint: STS Point for track " << fTrackID << " in detector " << fDetectorID << endl; cout << " Position (" << fX << ", " << fY << ", " << fZ << ") cm" << endl; cout << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ") GeV" << endl; cout << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss*1.0e06 << " keV" << endl; cout << " Light yield " << fLightYield << " [-], Light slow " << fSlow << " [-]" << endl; } // ------------------------------------------------------------------------- // ----- Point x coordinate from linear extrapolation ------------------ Double_t KrakowArrayPoint::GetX(Double_t z) const { // cout << fZ << " " << z << " " << fZ_out << endl; if ( (fZ_out-z)*(fZ-z) >= 0. ) return (fX_out+fX)/2.; Double_t dz = fZ_out - fZ; return ( fX + (z-fZ) / dz * (fX_out-fX) ); } // ------------------------------------------------------------------------- // ----- Point y coordinate from linear extrapolation ------------------ Double_t KrakowArrayPoint::GetY(Double_t z) const { if ( (fZ_out-z)*(fZ-z) >= 0. ) return (fY_out+fY)/2.; Double_t dz = fZ_out - fZ; // if ( TMath::Abs(dz) < 1.e-3 ) return (fY_out+fY)/2.; return ( fY + (z-fZ) / dz * (fY_out-fY) ); } // ------------------------------------------------------------------------- // ----- Public method IsUsable ---------------------------------------- Bool_t KrakowArrayPoint::IsUsable() const { Double_t dz = fZ_out - fZ; if ( TMath::Abs(dz) < 1.e-4 ) return kFALSE; return kTRUE; } // ------------------------------------------------------------------------- ClassImp(KrakowArrayPoint)