#include "THaScintHit.h"
THaScintHit::THaScintHit( const THaScintBar* bar,Int_t planenum, Int_t barnum,
Double_t ypos,
Double_t Tof, Double_t HitEnergy, Double_t Tdiff)
{
Clear();
fScBar = const_cast<THaScintBar*>(bar);
fPlaneNum = planenum;
fBarNum = barnum;
fHitYPos = ypos;
fHitTOF = Tof;
fHitEdep = HitEnergy;
fTdiff = Tdiff;
if (bar) {
fHitXPos = bar->GetXPos();
fHitZPos = bar->GetZPos();
fBarNum_nd = bar->GetBarNum_nd();
} else {
fHitXPos = -1.e5;
fHitZPos = -1.e5;
}
}
THaScintHit::THaScintHit(const THaScintHit* pScHit)
{
Clear();
CopyScintHit(pScHit);
}
THaScintHit::THaScintHit(const THaScintHit* pScHit, Int_t clusternum)
{
Clear();
fClusterNum=clusternum;
CopyScintHit(pScHit);
}
THaScintHit::THaScintHit(const THaScintHit* pScHit, Int_t planenum, Int_t Bar_nd)
{
Clear();
fPlaneNum=planenum;
fBarNum_nd=Bar_nd;
CopyScintHit(pScHit);
}
void THaScintHit::Clear(Option_t *) {
fScBar = 0;
fPlaneNum = -1;
fBarNum = 0;
fBarNum_nd = -1;
fOrder = 0;
fClusterNum = -1;
fHitXPos = fHitYPos = fHitZPos = fHitTOF = fHitEdep = fTdiff = 0;
}
THaScintHit::~THaScintHit()
{
fScBar = 0;
}
Int_t THaScintHit::CopyScintHit(const THaScintHit* pScHit)
{
if(pScHit){
fScBar = pScHit->fScBar;
fBarNum = pScHit->fBarNum;
if(fBarNum_nd<0) fBarNum_nd = pScHit->fBarNum_nd;
fHitXPos = pScHit->fHitXPos;
fHitYPos = pScHit->fHitYPos;
fHitZPos = pScHit->fHitZPos;
fHitTOF = pScHit->fHitTOF;
fHitEdep = pScHit->fHitEdep;
fTdiff = pScHit->fTdiff;
fOrder = pScHit->fOrder;
if(fClusterNum<0) fClusterNum = pScHit->fClusterNum;
if(fPlaneNum<0) fPlaneNum = pScHit->fPlaneNum;
}
return 0;
}
Int_t THaScintHit::Compare(const TObject* obj) const
{
const THaScintHit *h = static_cast<const THaScintHit*>(obj);
if (fPlaneNum < h->fPlaneNum) return -1;
if (fPlaneNum > h->fPlaneNum) return 1;
if (fBarNum < h->fBarNum) return -1;
if (fBarNum > h->fBarNum) return 1;
if (fHitTOF < h->fHitTOF) return -1;
if (fHitTOF > h->fHitTOF) return 1;
return 0;
}
ClassImp(THaScintHit)
Last update: Tue Jul 7 19:26:17 2009
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.