00001 #include "HitAtNu.h"
00002 #include "Validity/VldContext.h"
00003
00004 ClassImp(HitAtNu)
00005
00006
00007
00008 HitAtNu::HitAtNu(CandStripHandle* strip) :
00009 fTrkFlag(0),
00010 fShwFlag(0),
00011 fXtalkFlag(0),
00012 fPlaneView(-1),
00013 fStrip(0),
00014 fUid(0),
00015 fTime(-999.0)
00016 {
00017 if(strip){
00018 fStrip=strip;
00019 fTime=1.0e9*strip->GetTime();
00020 if( strip->GetPlaneView()==PlaneView::kU
00021 || strip->GetPlaneView()==PlaneView::kX
00022 || strip->GetPlaneView()==PlaneView::kA ) fPlaneView=0;
00023 if( strip->GetPlaneView()==PlaneView::kV
00024 || strip->GetPlaneView()==PlaneView::kY
00025 || strip->GetPlaneView()==PlaneView::kB ) fPlaneView=1;
00026 }
00027 }
00028
00029 HitAtNu::HitAtNu(const HitAtNu& rhs) :
00030 TObject(rhs),
00031 fTrkFlag(rhs.fTrkFlag),
00032 fShwFlag(rhs.fShwFlag),
00033 fXtalkFlag(rhs.fXtalkFlag),
00034 fPlaneView(rhs.fPlaneView),
00035 fStrip(rhs.fStrip),
00036 fUid(rhs.fUid),
00037 fTime(rhs.fTime)
00038 {
00039
00040 }
00041
00042 HitAtNu::~HitAtNu()
00043 {
00044
00045 }
00046
00047 CandStripHandle* HitAtNu::GetCandStripHandle()
00048 {
00049 return fStrip;
00050 }
00051
00052 Int_t HitAtNu::GetPlaneView() const
00053 {
00054 return fPlaneView;
00055 }
00056
00057 Int_t HitAtNu::GetPlane() const
00058 {
00059 if(fStrip) return fStrip->GetPlane();
00060 else return -1;
00061 }
00062
00063 Int_t HitAtNu::GetStrip() const
00064 {
00065 if(fStrip) return fStrip->GetStrip();
00066 else return -1;
00067 }
00068
00069 Double_t HitAtNu::GetCharge() const
00070 {
00071 if(fStrip) return fStrip->GetCharge();
00072 else return -1.0;
00073 }
00074
00075 Double_t HitAtNu::GetTime() const
00076 {
00077 return fTime;
00078 }
00079
00080 Double_t HitAtNu::GetTPos() const
00081 {
00082 if(fStrip) return fStrip->GetTPos();
00083 else return -1.0;
00084 }
00085
00086 Double_t HitAtNu::GetZPos() const
00087 {
00088 if(fStrip) return fStrip->GetZPos();
00089 else return -1.0;
00090 }
00091
00092 Int_t HitAtNu::GetDigits() const
00093 {
00094 if(fStrip) return (Int_t)(fStrip->GetNDaughters());
00095 else return 0;
00096 }
00097
00098 void HitAtNu::SetUID(Int_t uid)
00099 {
00100 fUid=uid;
00101 }
00102
00103 void HitAtNu::SetTrkFlag(Int_t flag)
00104 {
00105 fTrkFlag=flag;
00106 }
00107
00108 void HitAtNu::SetShwFlag(Int_t flag)
00109 {
00110 fShwFlag=flag;
00111 }
00112
00113 void HitAtNu::SetXtalkFlag(Int_t flag)
00114 {
00115 fXtalkFlag=flag;
00116 }
00117
00118 Int_t HitAtNu::GetUID() const
00119 {
00120 return fUid;
00121 }
00122
00123 Int_t HitAtNu::GetTrkFlag() const
00124 {
00125 return fTrkFlag;
00126 }
00127
00128 Int_t HitAtNu::GetShwFlag() const
00129 {
00130 return fShwFlag;
00131 }
00132
00133 Int_t HitAtNu::GetXtalkFlag() const
00134 {
00135 return fXtalkFlag;
00136 }
00137
00138 Int_t HitAtNu::IsTrkAssoc(HitAtNu* hit) const
00139 {
00140 if(hit) return 0;
00141 return 0;
00142 }
00143
00144 Int_t HitAtNu::IsShwAssoc(HitAtNu* hit) const
00145 {
00146 Double_t win=99.9;
00147 if(fStrip){
00148 if( hit->GetTime()-this->GetTime()>-win
00149 && hit->GetTime()-this->GetTime()<win ){
00150 if( hit->GetPlane()-this->GetPlane()>-5
00151 && hit->GetPlane()-this->GetPlane()<5
00152 && hit->GetStrip()-this->GetStrip()>-6
00153 && hit->GetStrip()-this->GetStrip()<6 ){
00154 if( hit->GetPlane()-this->GetPlane()>-3
00155 && hit->GetPlane()-this->GetPlane()<3
00156 && hit->GetStrip()-this->GetStrip()>-4
00157 && hit->GetStrip()-this->GetStrip()<4 )
00158 return 2; else return 1;
00159 }
00160 }
00161 }
00162 return 0;
00163 }
00164
00165 Int_t HitAtNu::IsDiffuseShwAssoc(HitAtNu* hit) const
00166 {
00167 Double_t win=99.9;
00168 if(fStrip){
00169 if( hit->GetTime()-this->GetTime()>-win
00170 && hit->GetTime()-this->GetTime()<win ){
00171 if( hit->GetPlane()-this->GetPlane()>-9
00172 && hit->GetPlane()-this->GetPlane()<9
00173 && hit->GetStrip()-this->GetStrip()>-21
00174 && hit->GetStrip()-this->GetStrip()<21 ){
00175 if( hit->GetPlane()-this->GetPlane()>-5
00176 && hit->GetPlane()-this->GetPlane()<5
00177 && hit->GetStrip()-this->GetStrip()>-11
00178 && hit->GetStrip()-this->GetStrip()<11 )
00179 return 2; else return 1;
00180 }
00181 }
00182 }
00183 return 0;
00184 }