Anp::DrawSpan Class Reference

#include <DrawSpan.h>

List of all members.

Public Member Functions

 DrawSpan ()
 ~DrawSpan ()
void Reset ()
void FindSpan (const Event &event, const Record &record)
void FindSpan (const Draw::SVec &uvec, const Draw::SVec &vvec)
void SetRangeU (TAxis *axis, float scale, float border) const
void SetRangeV (TAxis *axis, float scale, float border) const
void SetRangeZ (TAxis *axis, float scale, float border) const
bool InitU () const
bool InitV () const
bool InitZ () const
float GetMinU (float scale, float border) const
float GetMaxU (float scale, float border) const
float GetMinV (float scale, float border) const
float GetMaxV (float scale, float border) const
float GetMinZ (float scale, float border) const
float GetMaxZ (float scale, float border) const
double GetMinTime (double window) const
double GetMaxTime (double window) const

Private Member Functions

void Set (TAxis *axis, float min, float max) const
float Min (float pos, float scale) const
float Max (float pos, float scale) const

Private Attributes

bool fInitU
bool fInitV
bool fInitZ
bool fInitTime
float fMinU
float fMaxU
float fMinV
float fMaxV
float fMinZ
float fMaxZ
double fMinTime
double fMaxTime

Detailed Description

Definition at line 14 of file DrawSpan.h.


Constructor & Destructor Documentation

Anp::DrawSpan::DrawSpan (  ) 

Definition at line 15 of file DrawSpan.cxx.

00016    :fInitU(false),
00017     fInitV(false),
00018     fInitZ(false),
00019     fInitTime(false),
00020     fMinU(0.0),
00021     fMaxU(0.0),
00022     fMinV(0.0),
00023     fMaxV(0.0),
00024     fMinZ(0.0),
00025     fMaxZ(0.0),
00026     fMinTime(0.0),
00027     fMaxTime(0.0)
00028 {
00029 }

Anp::DrawSpan::~DrawSpan (  )  [inline]

Definition at line 19 of file DrawSpan.h.

00019 {}


Member Function Documentation

void Anp::DrawSpan::FindSpan ( const Draw::SVec uvec,
const Draw::SVec vvec 
)

Definition at line 227 of file DrawSpan.cxx.

References fInitTime, fInitU, fInitV, fInitZ, fMaxTime, fMaxU, fMaxV, fMaxZ, fMinTime, fMinU, fMinV, fMinZ, Anp::Strip::Time(), Anp::Strip::TPos(), and Anp::Strip::ZPos().

00228 {
00229    if(!uvec.empty())
00230    {   
00231       if(!fInitTime)
00232       {
00233          const Strip &strip = *(*uvec.begin());
00234          fMinTime = strip.Time();
00235          fMaxTime = strip.Time();
00236          fInitTime = true;
00237       }
00238       if(!fInitU)
00239       {
00240          const Strip &strip = *(*uvec.begin());
00241          fMinU = strip.TPos();
00242          fMaxU = strip.TPos();
00243          fInitU = true;
00244       }
00245       if(!fInitZ)
00246       {
00247          const Strip &strip = *(*uvec.begin());
00248          fMinZ = strip.ZPos();
00249          fMaxZ = strip.ZPos();
00250          fInitZ = true;
00251       }
00252 
00253       for(Draw::SIter sit = uvec.begin(); sit != uvec.end(); ++sit)
00254       {
00255          const float upos  = (*sit) -> TPos();
00256          const float zpos  = (*sit) -> ZPos();
00257          const double time = (*sit) -> Time();
00258          
00259          if(fMinU > upos)
00260          {
00261             fMinU = upos;
00262          }
00263          if(fMaxU < upos)
00264          {
00265             fMaxU = upos;
00266          }
00267          if(fMinZ > zpos)
00268          {
00269             fMinZ = zpos;
00270          }
00271          if(fMaxZ < zpos)
00272          {
00273             fMaxZ = zpos;
00274          }
00275          if(fMinTime > time)
00276          {
00277             fMinTime = time;
00278          }
00279          if(fMaxTime < time)
00280          {
00281             fMaxTime = time;
00282          }
00283       }
00284    }
00285 
00286    if(!vvec.empty())
00287    { 
00288       if(!fInitTime)
00289       {
00290          const Strip &strip = *(*vvec.begin());
00291          fMinTime = strip.Time();
00292          fMaxTime = strip.Time();
00293          fInitTime = true;
00294       }
00295       if(!fInitV)
00296       {
00297          const Strip &strip = *(*vvec.begin());
00298          fMinV = strip.TPos();
00299          fMaxV = strip.TPos();
00300          fInitV = true;
00301       }
00302       if(!fInitZ)
00303       {
00304          const Strip &strip = *(*vvec.begin());
00305          fMinZ = strip.ZPos();
00306          fMaxZ = strip.ZPos();
00307          fInitZ = true;
00308       }
00309 
00310       for(Draw::SIter sit = vvec.begin(); sit != vvec.end(); ++sit)
00311       {
00312          const float vpos  = (*sit) -> TPos();
00313          const float zpos  = (*sit) -> ZPos();
00314          const double time = (*sit) -> Time();
00315 
00316          if(fMinV > vpos)
00317          {
00318             fMinV = vpos;
00319          }
00320          if(fMaxV < vpos)
00321          {
00322             fMaxV = vpos;
00323          }
00324          if(fMinZ > zpos)
00325          {
00326             fMinZ = zpos;
00327          }
00328          if(fMaxZ < zpos)
00329          {
00330             fMaxZ = zpos;
00331          }      
00332          if(fMinTime > time)
00333          {
00334             fMinTime = time;
00335          }
00336          if(fMaxTime < time)
00337          {
00338             fMaxTime = time;
00339          }
00340       }
00341    }
00342    //   cout<<" FindSpan:: V("<<fMinV<<", "<<fMaxV<<") "<<"  U("<<fMinU<<", "<<fMaxU<<") "<<" Z("<<fMinZ<<", "<<fMaxZ<<") "<<endl;
00343 }

void Anp::DrawSpan::FindSpan ( const Event event,
const Record record 
)

Definition at line 202 of file DrawSpan.cxx.

References Anp::Event::EventIndex(), Anp::Record::StripBeg(), and Anp::Record::StripEnd().

Referenced by Anp::StdHepTab::Set(), Anp::EventAdcTab::Set(), Anp::EventHitTab::Set(), and Anp::SnarlAdcTab::Set().

00203 { 
00204    Draw::SVec uvec, vvec;
00205    
00206    for(Anp::StripIter sit = record.StripBeg(); sit != record.StripEnd(); ++sit)
00207    {
00208       if(!sit -> MatchEvt(event.EventIndex()))
00209       {
00210          continue;
00211       }
00212 
00213       if(sit->IsUview())
00214       {
00215          uvec.push_back(sit);
00216       }
00217       else
00218       {
00219          vvec.push_back(sit);
00220       }
00221    }
00222    
00223    FindSpan(uvec, vvec);
00224 }

double Anp::DrawSpan::GetMaxTime ( double  window  )  const

Definition at line 100 of file DrawSpan.cxx.

References fMaxTime.

00101 {
00102    if(window < 0.0)
00103    {
00104       return fMaxTime;
00105    }
00106    
00107    return fMaxTime + window;
00108 }

float Anp::DrawSpan::GetMaxU ( float  scale,
float  border 
) const

Definition at line 59 of file DrawSpan.cxx.

References fMaxU, and Max().

Referenced by SetRangeU().

00060 {
00061    return Max(fMaxU, scale) + border;
00062 }

float Anp::DrawSpan::GetMaxV ( float  scale,
float  border 
) const

Definition at line 71 of file DrawSpan.cxx.

References fMaxV, and Max().

Referenced by SetRangeV().

00072 {
00073    return Max(fMaxV, scale) + border;
00074 }

float Anp::DrawSpan::GetMaxZ ( float  scale,
float  border 
) const

Definition at line 83 of file DrawSpan.cxx.

References fMaxZ, and Max().

Referenced by Anp::StdHepTab::CreateArrows(), and SetRangeZ().

00084 {
00085    return Max(fMaxZ, scale) + border;
00086 }

double Anp::DrawSpan::GetMinTime ( double  window  )  const

Definition at line 89 of file DrawSpan.cxx.

References fMinTime.

00090 {
00091    if(window < 0.0)
00092    {
00093       return fMinTime;
00094    }
00095    
00096    return fMinTime - window;
00097 }

float Anp::DrawSpan::GetMinU ( float  scale,
float  border 
) const

Definition at line 53 of file DrawSpan.cxx.

References fMinU, and Min().

Referenced by SetRangeU().

00054 {
00055    return Min(fMinU, scale) - border;
00056 }

float Anp::DrawSpan::GetMinV ( float  scale,
float  border 
) const

Definition at line 65 of file DrawSpan.cxx.

References fMinV, and Min().

Referenced by SetRangeV().

00066 {
00067    return Min(fMinV, scale) - border;
00068 }

float Anp::DrawSpan::GetMinZ ( float  scale,
float  border 
) const

Definition at line 77 of file DrawSpan.cxx.

References fMinZ, and Min().

Referenced by Anp::StdHepTab::CreateArrows(), and SetRangeZ().

00078 {
00079    return Min(fMinZ, scale) - border;
00080 }

bool Anp::DrawSpan::InitU (  )  const

Definition at line 161 of file DrawSpan.cxx.

References fInitU.

Referenced by Anp::StdHepTab::ZoomIn(), Anp::SnarlAdcTab::ZoomIn(), Anp::EventHitTab::ZoomIn(), and Anp::EventAdcTab::ZoomIn().

00162 {
00163    return fInitU;
00164 }

bool Anp::DrawSpan::InitV (  )  const

Definition at line 167 of file DrawSpan.cxx.

References fInitV.

Referenced by Anp::StdHepTab::ZoomIn(), Anp::SnarlAdcTab::ZoomIn(), Anp::EventHitTab::ZoomIn(), and Anp::EventAdcTab::ZoomIn().

00168 {
00169    return fInitV;
00170 }

bool Anp::DrawSpan::InitZ (  )  const

Definition at line 173 of file DrawSpan.cxx.

References fInitZ.

Referenced by Anp::StdHepTab::ZoomIn(), Anp::SnarlAdcTab::ZoomIn(), Anp::EventHitTab::ZoomIn(), and Anp::EventAdcTab::ZoomIn().

00174 {
00175    return fInitZ;
00176 }

float Anp::DrawSpan::Max ( float  pos,
float  scale 
) const [private]

Definition at line 127 of file DrawSpan.cxx.

Referenced by GetMaxU(), GetMaxV(), and GetMaxZ().

00128 {
00129    if(scale < 1.0)
00130    {
00131       return pos;
00132    }
00133 
00134    if(pos < 0.0)
00135    {
00136       return pos / scale;
00137    }
00138 
00139    return pos * scale;
00140 }

float Anp::DrawSpan::Min ( float  pos,
float  scale 
) const [private]

Definition at line 111 of file DrawSpan.cxx.

Referenced by GetMinU(), GetMinV(), and GetMinZ().

00112 {
00113    if(scale < 1.0)
00114    {
00115       return pos;
00116    }
00117 
00118    if(pos < 0.0)
00119    {
00120       return pos * scale;
00121    }
00122 
00123    return pos / scale;
00124 }

void Anp::DrawSpan::Reset (  ) 

Definition at line 32 of file DrawSpan.cxx.

References fInitTime, fInitU, fInitV, fInitZ, fMaxTime, fMaxU, fMaxV, fMaxZ, fMinTime, fMinU, fMinV, and fMinZ.

Referenced by Anp::SnarlAdcTab::Reset(), Anp::StdHepTab::Reset(), Anp::EventAdcTab::Reset(), and Anp::EventHitTab::Reset().

00033 {
00034    fInitU = false;
00035    fInitV = false;
00036    fInitZ = false;
00037    fInitTime = false;
00038    
00039    fMinU = 0.0;
00040    fMaxU = 0.0;
00041    
00042    fMinV = 0.0;
00043    fMaxV = 0.0;
00044    
00045    fMinZ = 0.0;
00046    fMaxZ = 0.0;
00047 
00048    fMinTime = 0.0;
00049    fMaxTime = 0.0; 
00050 }

void Anp::DrawSpan::Set ( TAxis *  axis,
float  min,
float  max 
) const [private]

Definition at line 179 of file DrawSpan.cxx.

Referenced by SetRangeU(), SetRangeV(), and SetRangeZ().

00180 {
00181    if(!axis)
00182    {
00183       return;
00184    }
00185    
00186    const float xmax = axis -> GetXmax();
00187    const float xmin = axis -> GetXmin();
00188 
00189    if(min < xmin)
00190    {
00191       min = xmin;
00192    }
00193    if(max > xmax)
00194    {
00195       max = xmax;
00196    }
00197 
00198    axis -> SetRangeUser(min, max);
00199 }

void Anp::DrawSpan::SetRangeU ( TAxis *  axis,
float  scale,
float  border 
) const

Definition at line 143 of file DrawSpan.cxx.

References GetMaxU(), GetMinU(), and Set().

Referenced by Anp::StdHepTab::ZoomIn(), Anp::SnarlAdcTab::ZoomIn(), Anp::EventHitTab::ZoomIn(), and Anp::EventAdcTab::ZoomIn().

00144 {
00145    Set(axis, GetMinU(scale, border), GetMaxU(scale, border));
00146 }

void Anp::DrawSpan::SetRangeV ( TAxis *  axis,
float  scale,
float  border 
) const

Definition at line 149 of file DrawSpan.cxx.

References GetMaxV(), GetMinV(), and Set().

Referenced by Anp::StdHepTab::ZoomIn(), Anp::SnarlAdcTab::ZoomIn(), Anp::EventHitTab::ZoomIn(), and Anp::EventAdcTab::ZoomIn().

00150 {
00151    Set(axis, GetMinV(scale, border), GetMaxV(scale, border));
00152 }

void Anp::DrawSpan::SetRangeZ ( TAxis *  axis,
float  scale,
float  border 
) const

Definition at line 155 of file DrawSpan.cxx.

References GetMaxZ(), GetMinZ(), and Set().

Referenced by Anp::StdHepTab::ZoomIn(), Anp::SnarlAdcTab::ZoomIn(), Anp::EventHitTab::ZoomIn(), and Anp::EventAdcTab::ZoomIn().

00156 {
00157    Set(axis, GetMinZ(scale, border), GetMaxZ(scale, border));
00158 }


Member Data Documentation

bool Anp::DrawSpan::fInitTime [private]

Definition at line 56 of file DrawSpan.h.

Referenced by FindSpan(), and Reset().

bool Anp::DrawSpan::fInitU [private]

Definition at line 53 of file DrawSpan.h.

Referenced by FindSpan(), InitU(), and Reset().

bool Anp::DrawSpan::fInitV [private]

Definition at line 54 of file DrawSpan.h.

Referenced by FindSpan(), InitV(), and Reset().

bool Anp::DrawSpan::fInitZ [private]

Definition at line 55 of file DrawSpan.h.

Referenced by FindSpan(), InitZ(), and Reset().

double Anp::DrawSpan::fMaxTime [private]

Definition at line 68 of file DrawSpan.h.

Referenced by FindSpan(), GetMaxTime(), and Reset().

float Anp::DrawSpan::fMaxU [private]

Definition at line 59 of file DrawSpan.h.

Referenced by FindSpan(), GetMaxU(), and Reset().

float Anp::DrawSpan::fMaxV [private]

Definition at line 62 of file DrawSpan.h.

Referenced by FindSpan(), GetMaxV(), and Reset().

float Anp::DrawSpan::fMaxZ [private]

Definition at line 65 of file DrawSpan.h.

Referenced by FindSpan(), GetMaxZ(), and Reset().

double Anp::DrawSpan::fMinTime [private]

Definition at line 67 of file DrawSpan.h.

Referenced by FindSpan(), GetMinTime(), and Reset().

float Anp::DrawSpan::fMinU [private]

Definition at line 58 of file DrawSpan.h.

Referenced by FindSpan(), GetMinU(), and Reset().

float Anp::DrawSpan::fMinV [private]

Definition at line 61 of file DrawSpan.h.

Referenced by FindSpan(), GetMinV(), and Reset().

float Anp::DrawSpan::fMinZ [private]

Definition at line 64 of file DrawSpan.h.

Referenced by FindSpan(), GetMinZ(), and Reset().


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

Generated on 11 Jan 2018 for loon by  doxygen 1.6.1