ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtSiPoint.cxx
Go to the documentation of this file.
1 #include "AtSiPoint.h"
2 
3 #include <TVector3.h>
4 
5 #include <iostream>
6 
7 using std::cout;
8 using std::endl;
9 
11 
12 AtSiPoint::AtSiPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t tof, Double_t length,
13  Double_t eLoss)
14  : AtMCPoint(trackID, detID, pos, mom, tof, length, eLoss)
15 {
16 }
17 
18 AtSiPoint::AtSiPoint(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut,
19  Double_t tof, Double_t length, Double_t eLoss, TString VolName, Int_t detCopyID, Double_t EIni,
20  Double_t AIni, Int_t A, Int_t Z)
21  : AtMCPoint(trackID, detID, posIn, posOut, tof, length, eLoss, VolName, detCopyID, EIni, AIni, A, Z)
22 {
23  SetPositionOut(posOut);
24  SetMomentumOut(momOut);
25 }
26 
27 void AtSiPoint::Print(const Option_t *opt) const
28 {
29  cout << "-I- AtSiPoint: AtSiArray point for track " << fTrackID << " in detector " << fDetectorID << endl;
30  cout << " Position (" << fX << ", " << fY << ", " << fZ << ") cm" << endl;
31  cout << " Momentum (" << fPx << ", " << fPy << ", " << fPz << ") GeV" << endl;
32  cout << " Time " << fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss * 1.0e06 << " keV"
33  << endl;
34 }
35 // -------------------------------------------------------------------------
36 
37 // ----- Point x coordinate from linear extrapolation ------------------
38 Double_t AtSiPoint::GetX(Double_t z) const
39 {
40  // cout << fZ << " " << z << " " << fZ_out << endl;
41  if ((fZ_out - z) * (fZ - z) >= 0.)
42  return (fX_out + fX) / 2.;
43  Double_t dz = fZ_out - fZ;
44  return (fX + (z - fZ) / dz * (fX_out - fX));
45 }
46 // -------------------------------------------------------------------------
47 
48 // ----- Point y coordinate from linear extrapolation ------------------
49 Double_t AtSiPoint::GetY(Double_t z) const
50 {
51  if ((fZ_out - z) * (fZ - z) >= 0.)
52  return (fY_out + fY) / 2.;
53  Double_t dz = fZ_out - fZ;
54  // if ( TMath::Abs(dz) < 1.e-3 ) return (fY_out+fY)/2.;
55  return (fY + (z - fZ) / dz * (fY_out - fY));
56 }
57 
AtSiPoint::SetMomentumOut
void SetMomentumOut(TVector3 mom)
Definition: AtSiPoint.h:82
ClassImp
ClassImp(AtFindVertex)
AtSiPoint::GetX
Double_t GetX(Double_t z) const
Definition: AtSiPoint.cxx:38
AtSiPoint::Print
virtual void Print(const Option_t *opt) const
Definition: AtSiPoint.cxx:27
AtSiPoint::fZ_out
Double32_t fZ_out
Definition: AtSiPoint.h:17
AtSiPoint::GetY
Double_t GetY(Double_t z) const
Definition: AtSiPoint.cxx:49
AtSiPoint
Definition: AtSiPoint.h:14
AtSiPoint::fX_out
Double32_t fX_out
Definition: AtSiPoint.h:17
AtSiPoint::AtSiPoint
AtSiPoint()
Definition: AtSiPoint.cxx:10
AtMCPoint
Definition: AtMCPoint.h:26
AtSiPoint.h
AtSiPoint::SetPositionOut
void SetPositionOut(TVector3 pos)
Definition: AtSiPoint.h:75
AtSiPoint::fY_out
Double32_t fY_out
Definition: AtSiPoint.h:17