HoughTrans Class Reference

#include <HoughTrans.h>

List of all members.

Public Member Functions

 ~HoughTrans ()
 HoughTrans ()
 HoughTrans (Int_t numSamps, Float_t lowGrad, Float_t highGrad)
 HoughTrans (Int_t numSamps, Float_t lowGrad, Float_t highGrad, Float_t lowIcept, Float_t highIcept)
void SetVtxz (Float_t vertz)
void FillHough (NtpSRStrip *stp)
void FillHough (Float_t zPos, Float_t tPos)
void ResetHough ()
void DeleteHough ()
Int_t GetPeakHeight ()
Int_t GetPeakGradBin ()
Int_t GetPeakIceptBin ()
Float_t GetPeakGradVal ()
Float_t GetPeakIceptVal ()
Float_t GetRms (Float_t frac)

Public Attributes

TH2F * houghSpace
Float_t vtxz

Detailed Description

Definition at line 28 of file HoughTrans.h.


Constructor & Destructor Documentation

HoughTrans::~HoughTrans (  ) 

Definition at line 30 of file HoughTrans.cxx.

References houghSpace.

00030                        {
00031   // Mark, you need to delete histograms created with new!!!
00032   delete houghSpace; houghSpace=0;
00033 
00034 }

HoughTrans::HoughTrans (  ) 

Definition at line 23 of file HoughTrans.cxx.

References houghSpace, and vtxz.

00023                         :houghSpace("houghSpace","houghSpace",80,-2.0,2.0,80,-4.0,4.0),vtxz(0)
00024 {
00025   houghSpace = new TH2F("houghSpace","houghSpace",80,-2.0,2.0,80,-4.0,4.0);
00026   houghSpace->SetDirectory(0);
00027   vtxz = 0.0;
00028 }

HoughTrans::HoughTrans ( Int_t  numSamps,
Float_t  lowGrad,
Float_t  highGrad 
)

Definition at line 36 of file HoughTrans.cxx.

References houghSpace, and vtxz.

00036                                                                        :
00037 //houghSpace("houghSpace","houghSpace",numSamps,lowGrad,highGrad,numSamps,-4.0,4.0),vtxz(0)
00038 {
00039   
00040   houghSpace = new TH2F("houghSpace","houghSpace",numSamps,lowGrad,highGrad,numSamps,-4.0,4.0);
00041   houghSpace->SetDirectory(0);
00042   vtxz = 0.0;
00043 }

HoughTrans::HoughTrans ( Int_t  numSamps,
Float_t  lowGrad,
Float_t  highGrad,
Float_t  lowIcept,
Float_t  highIcept 
)

Definition at line 45 of file HoughTrans.cxx.

References houghSpace, and vtxz.

00045                                                                                                           :
00046 //houghSpace("houghSpace","houghSpace",numSamps,lowGrad,highGrad,numSamps,lowIcept,highIcept),vtxz(0)
00047 {
00048   houghSpace = new TH2F("houghSpace","houghSpace",numSamps,lowGrad,highGrad,numSamps,lowIcept,highIcept);
00049   houghSpace->SetDirectory(0);
00050   vtxz = 0.0;
00051 }


Member Function Documentation

void HoughTrans::DeleteHough (  ) 

Definition at line 79 of file HoughTrans.cxx.

References houghSpace.

00080 {
00081   delete houghSpace;
00082 }

void HoughTrans::FillHough ( Float_t  zPos,
Float_t  tPos 
)

Definition at line 63 of file HoughTrans.cxx.

References houghSpace, and vtxz.

00064 {
00065   if(zPos<vtxz) return;
00066   for(Int_t i=1;i<houghSpace->GetNbinsX();i++){
00067     Float_t gradient=(houghSpace->GetXaxis())->GetBinCenter(i);
00068     Float_t icept=tPos-gradient*(zPos-vtxz);
00069     if(icept>4.0 || icept<-4.0) continue; //max MINOS transverse dimensions
00070     houghSpace->Fill(gradient,icept);
00071   }
00072 }

void HoughTrans::FillHough ( NtpSRStrip stp  ) 

Definition at line 58 of file HoughTrans.cxx.

References NtpSRStrip::tpos, and NtpSRStrip::z.

Referenced by MadQEID::CalcQEVars().

00059 {
00060   FillHough(stp->z,stp->tpos);
00061 }

Int_t HoughTrans::GetPeakGradBin (  ) 

Definition at line 90 of file HoughTrans.cxx.

References houghSpace.

Referenced by GetRms().

00091 {
00092   Int_t x=0;
00093   Int_t y=0;
00094   Int_t z=0;
00095   houghSpace->GetMaximumBin(x,y,z);
00096   return x;
00097 }

Float_t HoughTrans::GetPeakGradVal (  ) 

Definition at line 108 of file HoughTrans.cxx.

References houghSpace.

00109 {
00110   Int_t x=0;
00111   Int_t y=0;
00112   Int_t z=0;
00113   houghSpace->GetMaximumBin(x,y,z);
00114   return (houghSpace->GetXaxis())->GetBinCenter(x);
00115 }

Int_t HoughTrans::GetPeakHeight (  ) 

Definition at line 84 of file HoughTrans.cxx.

References houghSpace.

Referenced by MadQEID::CalcQEVars(), and GetRms().

00085 {
00086   Int_t binmax = static_cast<Int_t>(houghSpace->GetBinContent(houghSpace->GetMaximumBin()));
00087   return binmax;
00088 }

Int_t HoughTrans::GetPeakIceptBin (  ) 

Definition at line 99 of file HoughTrans.cxx.

References houghSpace.

Referenced by GetRms().

00100 {
00101   Int_t x=0;
00102   Int_t y=0;
00103   Int_t z=0;
00104   houghSpace->GetMaximumBin(x,y,z);
00105   return y;
00106 }

Float_t HoughTrans::GetPeakIceptVal (  ) 

Definition at line 117 of file HoughTrans.cxx.

References houghSpace.

00118 {
00119   Int_t x=0;
00120   Int_t y=0;
00121   Int_t z=0;
00122   houghSpace->GetMaximumBin(x,y,z);
00123   return (houghSpace->GetYaxis())->GetBinCenter(y);
00124 }

Float_t HoughTrans::GetRms ( Float_t  frac  ) 

Definition at line 126 of file HoughTrans.cxx.

References count, GetPeakGradBin(), GetPeakHeight(), GetPeakIceptBin(), and houghSpace.

00127 {
00128   Int_t bincount = 0;
00129   Int_t mRmsInput[6400];
00130   Int_t cRmsInput[6400];
00131   for(Int_t mBin=1;mBin<houghSpace->GetNbinsX();mBin++){
00132     for(Int_t cBin=1;cBin<houghSpace->GetNbinsY();cBin++){
00133       if(houghSpace->GetBinContent(mBin,cBin)>=frac*GetPeakHeight()){
00134         mRmsInput[bincount]=mBin;
00135         cRmsInput[bincount]=cBin;
00136         bincount++;
00137       }
00138     }
00139   }
00140   if(bincount==0) return 0;
00141   Float_t squaresum = 0;
00142   for (Int_t count=0;count<bincount;count++) {
00143     squaresum+=(pow(static_cast<Float_t>((mRmsInput[count]-GetPeakGradBin())),2)+pow(static_cast<Float_t>((cRmsInput[count]-GetPeakIceptBin())),2));
00144   }
00145   Float_t Rms = sqrt(squaresum/bincount);
00146   return Rms;
00147 }

void HoughTrans::ResetHough (  ) 

Definition at line 74 of file HoughTrans.cxx.

References houghSpace.

Referenced by MadQEID::CalcQEVars().

00075 {
00076   houghSpace->Reset();
00077 }

void HoughTrans::SetVtxz ( Float_t  vertz  ) 

Definition at line 53 of file HoughTrans.cxx.

References vtxz.

Referenced by MadQEID::CalcQEVars().

00054 {
00055   vtxz=vertz;
00056 }


Member Data Documentation

Definition at line 59 of file HoughTrans.h.

Referenced by FillHough(), HoughTrans(), and SetVtxz().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1