Newer
Older
///////////////////////////////////////////////////////////////////////////////
// //
// THcHodoscopeHit //
// //
// Class representing a single raw hit for a hodoscope paddle //
// //
// Contains plane, counter and pos/neg adc and tdc values //
// //
///////////////////////////////////////////////////////////////////////////////
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <iostream>
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "THcHodoscopeHit.h"
using namespace std;
void THcHodoscopeHit::SetData(Int_t signal, Int_t data) {
if(signal==0) {
fADC_pos = data;
} else if (signal==1) {
fADC_neg = data;
} else if(signal==2) {
fTDC_pos = data;
} else if (signal==3) {
fTDC_neg = data;
}
}
Int_t THcHodoscopeHit::GetData(Int_t signal) {
if(signal==0) {
return(fADC_pos);
} else if (signal==1) {
return(fADC_neg);
} else if(signal==2) {
return(fTDC_pos);
} else if (signal==3) {
return(fTDC_neg);
}
return(-1); // Actually should throw exception
}
//_____________________________________________________________________________
THcHodoscopeHit& THcHodoscopeHit::operator=( const THcHodoscopeHit& rhs )
{
// Assignment operator.
THcRawHit::operator=(rhs);
if ( this != &rhs ) {
fPlane = rhs.fPlane;
fCounter = rhs.fCounter;
fADC_pos = rhs.fADC_pos;
fADC_neg = rhs.fADC_neg;
fTDC_pos = rhs.fTDC_pos;
fTDC_neg = rhs.fTDC_neg;
}
return *this;
}
//////////////////////////////////////////////////////////////////////////
ClassImp(THcHodoscopeHit)