Hall C ROOT/C++ Analyzer (hcana)
Hall C
Main Page
User's Classes
All Classes
Files
File List
File Members
THcShowerHit.cxx
Go to the documentation of this file.
1
5
#include "
THcShowerHit.h
"
6
7
//ClassImp(THcShowerHit)
8
9
using namespace
std
;
10
11
THcShowerHit::THcShowerHit
() {
//default constructor
12
fCol=fRow=0;
13
fX=fY=fZ=0.;
14
fE=0.;
15
fEpos=0.;
16
fEneg=0.;
17
}
18
19
THcShowerHit::THcShowerHit
(
Int_t
hRow,
Int_t
hCol,
Double_t
hX,
Double_t
hY,
Double_t
hZ,
20
Double_t
hE,
Double_t
hEpos,
Double_t
hEneg) {
21
fRow=hRow;
22
fCol=hCol;
23
fX=hX;
24
fY=hY;
25
fZ=hZ;
26
fE=hE;
27
fEpos=hEpos;
28
fEneg=hEneg;
29
}
30
31
//____________________________________________________________________________
32
// Decide if a hit is neighbouring the current hit.
33
// Two hits are neighbours if share a side or a corner,
34
// or in the same row but separated by no more than a block.
35
//
36
bool
THcShowerHit::isNeighbour
(
THcShowerHit
* hit1) {
37
//Is hit1 neighbouring this hit?
38
Int_t
dRow = fRow-(*hit1).fRow;
39
Int_t
dCol = fCol-(*hit1).fCol;
40
return
(
TMath::Abs
(dRow)<2 &&
TMath::Abs
(dCol)<2) ||
41
(dRow==0 &&
TMath::Abs
(dCol)<3);
42
}
43
44
//____________________________________________________________________________
45
//Print out hit information
46
//
47
void
THcShowerHit::show
() {
48
cout <<
"row="
<< fRow+1 <<
" column="
<< fCol+1
49
<<
" x="
<< fX <<
" y="
<< fY <<
" z="
<< fZ
50
<<
" E="
<< fE <<
" Epos="
<< fEpos <<
" Eneg="
<< fEneg << endl;
51
}
52
53
//____________________________________________________________________________
54
// Define < operator in order to fill in set of hits in a sorted manner.
55
//
56
bool
THcShowerHit::operator<
(
THcShowerHit
rhs)
const
{
57
if
(fCol != rhs.
fCol
)
58
return
fCol < rhs.
fCol
;
59
else
60
return
fRow < rhs.
fRow
;
61
}
THcShowerHit::fCol
Int_t fCol
Definition:
THcShowerHit.h:17
THcShowerHit::fRow
Int_t fRow
Definition:
THcShowerHit.h:17
THcShowerHit::isNeighbour
bool isNeighbour(THcShowerHit *hit1)
Definition:
THcShowerHit.cxx:36
Int_t
int Int_t
std
STL namespace.
TMath::Abs
Short_t Abs(Short_t d)
THcShowerHit::show
void show()
Definition:
THcShowerHit.cxx:47
THcShowerHit
Definition:
THcShowerHit.h:15
THcShowerHit::operator<
bool operator<(THcShowerHit rhs) const
Definition:
THcShowerHit.cxx:56
Double_t
double Double_t
THcShowerHit.h
THcShowerHit::THcShowerHit
THcShowerHit()
Definition:
THcShowerHit.cxx:11
src
THcShowerHit.cxx
Generated by
1.8.10