DCHit Class Reference

#include <DCHit.h>

List of all members.

Public Member Functions

 DCHit ()
 DCHit (const DCHit &d)
 DCHit (float zp, float tp, float s, float time)
 DCHit (UberHit *uh)
 ~DCHit ()
float GetZpos () const
float GetTpos () const
float GetPH () const
float GetTime () const
void Print (Option_t *option="") const
void Draw (Option_t *option="")
void SetData (const char *cx, const char *cy, const char *cz="")
void GetData (float &x, float &y, float &z)
bool operator< (const DCHit &dc) const
DCHit operator- (const DCHit &dc) const
DCHit operator+ (const DCHit &dc) const
float abs ()
bool operator== (const DCHit &dc) const

Private Attributes

float zpos
float tpos
float pulseheight
float time
float drawx
float drawy
float drawz

Detailed Description

Definition at line 7 of file DCHit.h.


Constructor & Destructor Documentation

DCHit::DCHit (  ) 

Definition at line 18 of file DCHit.cxx.

00018             :
00019    zpos(0),
00020    tpos(0),
00021    pulseheight(0),
00022    time(0),
00023    drawx(0.),
00024    drawy(0.),
00025    drawz(0.)
00026 {}

DCHit::DCHit ( const DCHit d  ) 

Definition at line 28 of file DCHit.cxx.

00028                           :
00029   TObject::TObject(),
00030   zpos(d.zpos),
00031   tpos(d.tpos),
00032   pulseheight(d.pulseheight),
00033   time(d.time),
00034   drawx(d.drawx),
00035   drawy(d.drawy),
00036   drawz(d.drawz)
00037 {}

DCHit::DCHit ( float  zp,
float  tp,
float  s,
float  time 
)

Definition at line 39 of file DCHit.cxx.

00039                                                 :
00040    zpos(zp),
00041    tpos(tp),
00042    pulseheight(s),
00043    time(t),
00044    drawx(0.),
00045    drawy(0.),
00046    drawz(0.)
00047 {}

DCHit::DCHit ( UberHit uh  ) 

Definition at line 49 of file DCHit.cxx.

References drawx, drawy, drawz, UberHit::GetNegMIP(), UberHit::GetNegTime(), UberHit::GetPlane(), UberHit::GetPosMIP(), UberHit::GetPosTime(), UberHit::GetStrip(), pulseheight, time, tpos, and zpos.

00050 {
00051    zpos=uh->GetPlane()*5.94;
00052    tpos=uh->GetStrip()*4.1;
00053    pulseheight=uh->GetPosMIP()+uh->GetNegMIP();
00054    time=((uh->GetPosMIP()*uh->GetPosTime()+
00055           uh->GetNegMIP()*uh->GetNegTime())/
00056          (uh->GetPosMIP()+uh->GetNegMIP()));
00057    drawx=0.;
00058    drawy=0.;
00059    drawz=0.;
00060 }

DCHit::~DCHit (  ) 

Definition at line 62 of file DCHit.cxx.

00063 {}


Member Function Documentation

float DCHit::abs (  )  [inline]

Definition at line 90 of file DCHit.h.

References GetTpos(), and GetZpos().

00090 {return sqrt(GetZpos()*GetZpos()+GetTpos()*GetTpos());}

void DCHit::Draw ( Option_t *  option = ""  ) 

Definition at line 93 of file DCHit.cxx.

References Munits::m, tpos, and zpos.

00094 {
00095    TMarker *m = new TMarker(1.*zpos,1*tpos,8);   
00096    m->Draw();
00097 }

void DCHit::GetData ( float &  x,
float &  y,
float &  z 
) [inline]

Definition at line 25 of file DCHit.h.

References drawx, drawy, and drawz.

Referenced by MSTCalcAna::GraphLoop().

00025 {x=drawx;y=drawy;z=drawz;}

float DCHit::GetPH (  )  const [inline]

Definition at line 19 of file DCHit.h.

References pulseheight.

Referenced by operator<().

00019 {return pulseheight;}

float DCHit::GetTime ( void   )  const [inline]

Definition at line 20 of file DCHit.h.

00020 {return time;}

float DCHit::GetTpos (  )  const [inline]

Definition at line 18 of file DCHit.h.

References tpos.

Referenced by abs(), operator<(), and operator<().

00018 {return tpos;}

float DCHit::GetZpos (  )  const [inline]

Definition at line 17 of file DCHit.h.

References zpos.

Referenced by abs(), operator<(), and operator<().

00017 {return zpos;}

DCHit DCHit::operator+ ( const DCHit dc  )  const [inline]

Definition at line 68 of file DCHit.h.

References drawx, drawy, drawz, pulseheight, time, tpos, and zpos.

00068                                             {
00069       DCHit newhit;
00070       newhit.zpos=zpos+dc.zpos;
00071       newhit.tpos=tpos+dc.tpos;
00072       newhit.pulseheight=(pulseheight+dc.pulseheight);
00073       if(pulseheight+dc.pulseheight!=0){
00074          newhit.time=((pulseheight*time+dc.pulseheight*dc.time)/
00075                       (pulseheight+dc.pulseheight));
00076       }
00077       else{
00078          newhit.time=0;
00079       }
00080       //note, get data will work the same way for the new DCHit as it did
00081       //for the first dchit (not the added one)
00082       newhit.drawx=drawx+dc.drawx;
00083       newhit.drawy=drawy+dc.drawy;
00084       //this is going to get you into trouble.  Need a better way to 
00085       //set what data is going to be assigned to these variables.
00086       newhit.drawz=(drawz+dc.drawz);
00087       return newhit;
00088    }

DCHit DCHit::operator- ( const DCHit dc  )  const [inline]

Definition at line 44 of file DCHit.h.

References drawx, drawy, drawz, pulseheight, time, tpos, and zpos.

00044                                             {
00045       DCHit newhit;
00046       newhit.zpos=zpos-dc.zpos;
00047       newhit.tpos=tpos-dc.tpos;
00048       if(pulseheight+dc.pulseheight!=0){
00049          newhit.pulseheight=2*((pulseheight-dc.pulseheight)/
00050                                (pulseheight+dc.pulseheight));
00051       }
00052       else{
00053          newhit.pulseheight=0.;
00054       }
00055 
00056       newhit.time=time-dc.time;
00057       newhit.drawx=drawx-dc.drawx;
00058       newhit.drawy=drawy-dc.drawy;
00059       if(drawz+dc.drawz!=0){
00060          newhit.drawz=2*(drawz-dc.drawz)/(drawz+dc.drawz);
00061       }
00062       else{
00063          newhit.drawz=0.;
00064       }
00065       return newhit;
00066    }

bool DCHit::operator< ( const DCHit dc  )  const [inline]

Definition at line 27 of file DCHit.h.

References GetPH(), GetTpos(), GetZpos(), pulseheight, tpos, and zpos.

00027                                            {
00028       if(zpos<dc.GetZpos()){
00029          return true;
00030       }
00031       else if(zpos==dc.GetZpos()){
00032          if(pulseheight>dc.GetPH()){
00033             return true;
00034          }
00035          else if(pulseheight==dc.GetPH()){
00036             if(tpos<dc.GetTpos()){
00037                return true;
00038             }       
00039          }
00040       }
00041       return false;
00042    }

bool DCHit::operator== ( const DCHit dc  )  const [inline]

Definition at line 92 of file DCHit.h.

References pulseheight, time, tpos, and zpos.

00092                                            {
00093      if((zpos==dc.zpos)&&
00094         (tpos==dc.tpos)&&
00095         (pulseheight==dc.pulseheight)&&
00096         (time==dc.time)) return true;
00097      return false;
00098    }

void DCHit::Print ( Option_t *  option = ""  )  const

Definition at line 84 of file DCHit.cxx.

References pulseheight, time, tpos, and zpos.

00085 {
00086 
00087    cout<<"Zpos "<<zpos<<" tpos "<<tpos
00088        <<" PulseHeight "<<pulseheight<<" Time "<<time<<endl;
00089 
00090 }

void DCHit::SetData ( const char *  cx,
const char *  cy,
const char *  cz = "" 
)

Definition at line 99 of file DCHit.cxx.

References drawx, drawy, drawz, pulseheight, time, tpos, and zpos.

Referenced by MSTCalcAna::FillHitSets().

00100 {
00101    if((string)(cx)=="zpos"){
00102       drawx=1.*zpos;
00103    }
00104    else if((string)(cx)=="tpos"){
00105       drawx=1.*tpos;
00106    }
00107    else if((string)(cx)=="pulseheight"){
00108       drawx=pulseheight;
00109    }
00110    else if((string)(cx)=="time"){
00111       drawx=time;
00112    }
00113    else{
00114       cout<<"Error in set data, don't know option "<<cx<<endl;
00115       cout<<"Setting cx to zpos"<<endl;
00116       drawx=zpos;
00117    }
00118 
00119    if((string)(cy)=="zpos"){
00120       drawy=1.*zpos;
00121    }
00122    else if((string)(cy)=="tpos"){
00123       drawy=1.*tpos;
00124    }
00125    else if((string)(cy)=="pulseheight"){
00126       drawy=pulseheight;
00127    }
00128    else if((string)(cy)=="time"){
00129       drawy=time;
00130    }
00131    else{
00132       cout<<"Error in set data, don't know option "<<cy<<endl;
00133       cout<<"Setting cy to zpos"<<endl;
00134       drawy=zpos;
00135    }
00136 
00137    if((string)(cz)=="zpos"){
00138       drawz=1.*zpos;
00139    }
00140    else if((string)(cz)=="tpos"){
00141       drawz=1.*tpos;
00142    }
00143    else if((string)(cz)=="pulseheight"){
00144       drawz=pulseheight;
00145    }
00146    else if((string)(cz)=="time"){
00147       drawz=time;
00148    }
00149    else if((string)(cz)==""){
00150    }
00151    else{
00152       cout<<"Error in set data, don't know option "<<cz<<endl;
00153       cout<<"Setting cz to zpos"<<endl;
00154       drawz=zpos;
00155    }
00156 
00157 }


Member Data Documentation

float DCHit::drawx [private]

Definition at line 107 of file DCHit.h.

Referenced by DCHit(), GetData(), operator+(), operator-(), and SetData().

float DCHit::drawy [private]

Definition at line 108 of file DCHit.h.

Referenced by DCHit(), GetData(), operator+(), operator-(), and SetData().

float DCHit::drawz [private]

Definition at line 109 of file DCHit.h.

Referenced by DCHit(), GetData(), operator+(), operator-(), and SetData().

float DCHit::pulseheight [private]

Definition at line 104 of file DCHit.h.

Referenced by DCHit(), GetPH(), operator+(), operator-(), operator<(), operator==(), Print(), and SetData().

float DCHit::time [private]

Definition at line 105 of file DCHit.h.

Referenced by DCHit(), operator+(), operator-(), operator==(), Print(), and SetData().

float DCHit::tpos [private]

Definition at line 103 of file DCHit.h.

Referenced by DCHit(), Draw(), GetTpos(), operator+(), operator-(), operator<(), operator==(), Print(), and SetData().

float DCHit::zpos [private]

Definition at line 102 of file DCHit.h.

Referenced by DCHit(), Draw(), GetZpos(), operator+(), operator-(), operator<(), operator==(), Print(), and SetData().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1