Neutral Particle Spectrometer analysis code
Loading...
Searching...
No Matches
THcNPSShowerHit.cxx
Go to the documentation of this file.
1
5
#include "
THcNPSShowerHit.h
"
6
7
//ClassImp(THcNPSShowerHit)
8
9
using namespace
std
;
10
11
THcNPSShowerHit::THcNPSShowerHit
() {
//default constructor
12
13
fID
=
fCol
=
fRow
=0;
14
fX
=
fY
=
fZ
=0.;
15
fE
=0.;
16
fT
=0.;
17
fPI
=0.;
18
19
}
20
21
THcNPSShowerHit::THcNPSShowerHit
(
Int_t
block_id,
Int_t
hRow,
Int_t
hCol,
Double_t
hX,
Double_t
hY,
Double_t
hZ,
22
Double_t
hE,
Double_t
hT,
Double_t
hPI) {
23
fID
=block_id;
24
fRow
=hRow;
25
fCol
=hCol;
26
fX
=hX;
27
fY
=hY;
28
fZ
=hZ;
29
fE
=hE;
30
fT
=hT;
31
fPI
=hPI;
32
}
33
34
//____________________________________________________________________________
35
// Decide if a hit is neighbouring the current hit.
36
// Two hits are neighbours if share a side or a corner,
37
// or in the same row but separated by no more than a block.
38
//
39
bool
THcNPSShowerHit::isNeighbour
(
THcNPSShowerHit
* hit1) {
40
//Is hit1 neighbouring this hit?
41
Int_t
dRow =
fRow
-(*hit1).fRow;
42
Int_t
dCol =
fCol
-(*hit1).fCol;
43
return
(
TMath::Abs
(dRow)<2 &&
TMath::Abs
(dCol)<2) ||
44
(dRow==0 &&
TMath::Abs
(dCol)<3);
45
}
46
47
//____________________________________________________________________________
48
//Print out hit information
49
//
50
void
THcNPSShowerHit::show
() {
51
cout <<
"row="
<<
fRow
+1 <<
" column="
<<
fCol
+1
52
<<
" x="
<<
fX
<<
" y="
<<
fY
<<
" z="
<<
fZ
53
<<
" E="
<<
fE
<<
" T="
<<
fT
<< endl;
54
}
55
56
//____________________________________________________________________________
57
// Define < operator in order to fill in set of hits in a sorted manner.
58
//
59
bool
THcNPSShowerHit::operator<
(
THcNPSShowerHit
rhs)
const
{
60
if
(
fCol
!= rhs.
fCol
)
61
return
fCol
< rhs.
fCol
;
62
else
63
return
fRow
< rhs.
fRow
;
64
}
Int_t
int Int_t
Double_t
double Double_t
THcNPSShowerHit.h
THcNPSShowerHit
Definition
THcNPSShowerHit.h:15
THcNPSShowerHit::fZ
Double_t fZ
Definition
THcNPSShowerHit.h:18
THcNPSShowerHit::fPI
Double_t fPI
Definition
THcNPSShowerHit.h:21
THcNPSShowerHit::operator<
bool operator<(THcNPSShowerHit rhs) const
Definition
THcNPSShowerHit.cxx:59
THcNPSShowerHit::fCol
Int_t fCol
Definition
THcNPSShowerHit.h:17
THcNPSShowerHit::THcNPSShowerHit
THcNPSShowerHit()
Definition
THcNPSShowerHit.cxx:11
THcNPSShowerHit::show
void show()
Definition
THcNPSShowerHit.cxx:50
THcNPSShowerHit::fY
Double_t fY
Definition
THcNPSShowerHit.h:18
THcNPSShowerHit::fT
Double_t fT
Definition
THcNPSShowerHit.h:20
THcNPSShowerHit::fID
Int_t fID
Definition
THcNPSShowerHit.h:17
THcNPSShowerHit::fRow
Int_t fRow
Definition
THcNPSShowerHit.h:17
THcNPSShowerHit::fE
Double_t fE
Definition
THcNPSShowerHit.h:19
THcNPSShowerHit::isNeighbour
bool isNeighbour(THcNPSShowerHit *hit1)
Definition
THcNPSShowerHit.cxx:39
THcNPSShowerHit::fX
Double_t fX
Definition
THcNPSShowerHit.h:18
TMath::Abs
Double_t Abs(Double_t d)
std
STL namespace.
src
THcNPSShowerHit.cxx
Generated by
1.9.8