#include "THaAdcHit.h"
#include "THaScintPMT.h"
using namespace std;
THaAdcHit::THaAdcHit(THaScintPMT* pmt, Int_t rawampl):fPMT(pmt),
fRawAmpl(rawampl)
{
if (pmt) {
fBarNum = pmt->GetBarNum();
fSide = pmt->GetSide();
} else {
fBarNum = 0;
fSide = 0;
}
CorrectHit();
}
void THaAdcHit::CorrectHit() {
THaScintPMT* pmt = GetPMT();
if (pmt) {
fAmplPedCor = fRawAmpl - pmt->GetPed();
fAmpl = fAmplPedCor * pmt->GetGain();
} else {
fAmplPedCor = 0;
fAmpl = 0;
}
}
Int_t THaAdcHit::Compare(const TObject *obj) const {
const THaAdcHit *h = static_cast<const THaAdcHit*>(obj);
if (fSide < h->fSide) return -1;
if (fSide > h->fSide) return 1;
if (fBarNum < h->fBarNum) return -1;
if (fBarNum > h->fBarNum) return 1;
if (fAmpl < h->fAmpl) return 1;
if (fAmpl > h->fAmpl) return -1;
return 0;
}
void THaAdcHit::Clear(Option_t *s) {
fPMT = 0;
fRawAmpl = fAmplPedCor = fSide = 0;
fBarNum = -1;
fAmpl = 0;
}
ClassImp(THaAdcHit)
Last update: Tue Jul 7 19:26:16 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.