#include <TrackCamAtNu.h>
Public Member Functions | |
TrackCamAtNu (CandSliceHandle *slice) | |
virtual | ~TrackCamAtNu () |
CandSliceHandle * | GetCandSliceHandle () const |
int | GetBegPlane () const |
int | GetEndPlane () const |
void | AddHit (HitCamAtNu *hit) |
bool | ContainsHit (HitCamAtNu *hit) const |
HitCamAtNu * | GetHit (unsigned int i) const |
double | GetBegTPos () |
double | GetEndTPos () |
double | GetDir (int Plane1, int Plane2) |
double | GetBegDir () |
double | GetEndDir () |
double | GetBegZPos () const |
double | GetEndZPos () const |
int | GetPlaneView () const |
unsigned int | GetEntries () const |
int | GetUID () const |
void | SetUID (int UIDNum) |
void | SetPartner (TrackCamAtNu *objtrk) |
TrackCamAtNu * | GetPartner () const |
Private Attributes | |
CandSliceHandle * | fSlice |
int | fBegPlane |
int | fEndPlane |
double | fBegZ |
double | fEndZ |
int | fUID |
TrackCamAtNu * | fPartner |
int | fPlaneView |
vector< HitCamAtNu * > | HitsInTrack |
Definition at line 19 of file TrackCamAtNu.h.
TrackCamAtNu::TrackCamAtNu | ( | CandSliceHandle * | slice | ) |
TrackCamAtNu::~TrackCamAtNu | ( | ) | [virtual] |
Definition at line 28 of file TrackCamAtNu.cxx.
References HitsInTrack.
00029 { 00030 HitsInTrack.clear(); 00031 }
void TrackCamAtNu::AddHit | ( | HitCamAtNu * | hit | ) |
Definition at line 36 of file TrackCamAtNu.cxx.
References ContainsHit(), fBegPlane, fBegZ, fEndPlane, fEndZ, fPlaneView, GetEntries(), VHS::GetPlane(), HitCamAtNu::GetPlane(), HitCamAtNu::GetPlaneView(), HitCamAtNu::GetZPos(), and HitsInTrack.
00037 { 00038 if(this->GetEntries()==0) { fPlaneView=hit->GetPlaneView(); } 00039 00040 if(this->ContainsHit(hit)==true) {return;} 00041 HitsInTrack.push_back(hit); 00042 00043 if( fBegPlane > hit->GetPlane()){ fBegPlane = hit->GetPlane(); fBegZ = hit->GetZPos();} 00044 if( fEndPlane < hit->GetPlane()){ fEndPlane = hit->GetPlane(); fEndZ = hit->GetZPos();} 00045 00046 return; 00047 }
bool TrackCamAtNu::ContainsHit | ( | HitCamAtNu * | hit | ) | const |
Definition at line 52 of file TrackCamAtNu.cxx.
References HitsInTrack.
Referenced by AddHit().
00053 { 00054 for(unsigned int i=0; i<HitsInTrack.size(); ++i) { 00055 if(hit==HitsInTrack[i]) {return true;} 00056 } 00057 00058 return false; 00059 }
double TrackCamAtNu::GetBegDir | ( | ) |
int TrackCamAtNu::GetBegPlane | ( | ) | const [inline] |
Definition at line 27 of file TrackCamAtNu.h.
References fBegPlane.
Referenced by AlgShowerCam::FindShowerVertex(), and AlgAtmosShowerList::FormVertexShowers().
00027 {return fBegPlane;};
double TrackCamAtNu::GetBegTPos | ( | ) |
Definition at line 73 of file TrackCamAtNu.cxx.
References fBegPlane, HitCamAtNu::GetPlane(), HitCamAtNu::GetTPos(), and HitsInTrack.
00074 { 00075 double tot=0.0,begt=0.0; 00076 unsigned int nhits = HitsInTrack.size(); 00077 00078 for(unsigned int i=0; i<nhits; ++i) { 00079 //find the hits on the first plane in the track 00080 HitCamAtNu* hit = HitsInTrack[i]; 00081 00082 if(hit->GetPlane()==fBegPlane) { 00083 begt+=hit->GetTPos(); 00084 tot+=1.0; 00085 } 00086 } 00087 if(tot>0) return (begt/tot); 00088 else return 0; 00089 }
double TrackCamAtNu::GetBegZPos | ( | ) | const [inline] |
CandSliceHandle* TrackCamAtNu::GetCandSliceHandle | ( | ) | const [inline] |
double TrackCamAtNu::GetDir | ( | int | Plane1, | |
int | Plane2 | |||
) |
Definition at line 115 of file TrackCamAtNu.cxx.
References HitCamAtNu::GetPlane(), HitCamAtNu::GetTPos(), HitCamAtNu::GetZPos(), and HitsInTrack.
Referenced by GetBegDir(), and GetEndDir().
00116 { 00117 double z=0.0,t=0.0; 00118 double sw=0.0,swx=0.0,swx2=0.0; 00119 double swy=0.0,swyx=0.0; 00120 unsigned int nhits = HitsInTrack.size(); 00121 00122 for( unsigned int i=0; i<nhits; ++i) { 00123 HitCamAtNu* hit = HitsInTrack[i]; 00124 00125 //find the hits in the end region of the track 00126 if(hit->GetPlane()>=Plane1 && hit->GetPlane()<=Plane2) { 00127 z=hit->GetZPos(); 00128 t=hit->GetTPos(); 00129 sw+=1.0; 00130 swx+=z; 00131 swx2+=z*z; 00132 swy+=t; 00133 swyx+=t*z; 00134 } 00135 } 00136 if((swx*swx-sw*swx2)!=0) {return (swx*swy-sw*swyx)/(swx*swx-sw*swx2);} 00137 else return 0; 00138 }
double TrackCamAtNu::GetEndDir | ( | ) |
int TrackCamAtNu::GetEndPlane | ( | ) | const [inline] |
Definition at line 28 of file TrackCamAtNu.h.
References fEndPlane.
Referenced by AlgShowerCam::FindShowerVertex(), and AlgAtmosShowerList::FormVertexShowers().
00028 {return fEndPlane;};
double TrackCamAtNu::GetEndTPos | ( | ) |
Definition at line 94 of file TrackCamAtNu.cxx.
References fEndPlane, HitCamAtNu::GetPlane(), HitCamAtNu::GetTPos(), and HitsInTrack.
00095 { 00096 double tot=0.0,endt=0.0; 00097 unsigned int nhits = HitsInTrack.size(); 00098 00099 for(unsigned int i=0; i<nhits; ++i) { 00100 //find the hits on the first plane in the track 00101 HitCamAtNu* hit = HitsInTrack[i]; 00102 00103 if(hit->GetPlane()==fEndPlane) { 00104 endt+=hit->GetTPos(); 00105 tot+=1.0; 00106 } 00107 } 00108 if(tot>0) return (endt/tot); 00109 else return 0; 00110 }
double TrackCamAtNu::GetEndZPos | ( | ) | const [inline] |
unsigned int TrackCamAtNu::GetEntries | ( | ) | const [inline] |
Definition at line 41 of file TrackCamAtNu.h.
References HitsInTrack.
Referenced by AddHit(), AlgAtmosShowerList::FormDummyTracks(), and AlgAtmosShowerList::FormVertexShowers().
00041 {return HitsInTrack.size();};
HitCamAtNu * TrackCamAtNu::GetHit | ( | unsigned int | i | ) | const |
Definition at line 64 of file TrackCamAtNu.cxx.
References HitsInTrack.
Referenced by AlgAtmosShowerList::FormDummyTracks(), and AlgAtmosShowerList::FormVertexShowers().
00065 { 00066 if(i<HitsInTrack.size()) {return HitsInTrack[i];} 00067 else {return 0;} 00068 }
TrackCamAtNu* TrackCamAtNu::GetPartner | ( | ) | const [inline] |
int TrackCamAtNu::GetPlaneView | ( | ) | const [inline] |
int TrackCamAtNu::GetUID | ( | ) | const [inline] |
void TrackCamAtNu::SetPartner | ( | TrackCamAtNu * | objtrk | ) | [inline] |
void TrackCamAtNu::SetUID | ( | int | UIDNum | ) | [inline] |
int TrackCamAtNu::fBegPlane [private] |
Definition at line 52 of file TrackCamAtNu.h.
Referenced by AddHit(), GetBegDir(), GetBegPlane(), and GetBegTPos().
double TrackCamAtNu::fBegZ [private] |
Definition at line 54 of file TrackCamAtNu.h.
Referenced by AddHit(), and GetBegZPos().
int TrackCamAtNu::fEndPlane [private] |
Definition at line 53 of file TrackCamAtNu.h.
Referenced by AddHit(), GetEndDir(), GetEndPlane(), and GetEndTPos().
double TrackCamAtNu::fEndZ [private] |
Definition at line 55 of file TrackCamAtNu.h.
Referenced by AddHit(), and GetEndZPos().
TrackCamAtNu* TrackCamAtNu::fPartner [private] |
Definition at line 57 of file TrackCamAtNu.h.
Referenced by GetPartner(), and SetPartner().
int TrackCamAtNu::fPlaneView [private] |
Definition at line 58 of file TrackCamAtNu.h.
Referenced by AddHit(), and GetPlaneView().
CandSliceHandle* TrackCamAtNu::fSlice [private] |
Definition at line 47 of file TrackCamAtNu.h.
Referenced by GetCandSliceHandle().
int TrackCamAtNu::fUID [private] |
Definition at line 56 of file TrackCamAtNu.h.
vector<HitCamAtNu*> TrackCamAtNu::HitsInTrack [private] |
Definition at line 60 of file TrackCamAtNu.h.
Referenced by AddHit(), ContainsHit(), GetBegTPos(), GetDir(), GetEndTPos(), GetEntries(), GetHit(), and ~TrackCamAtNu().