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
9using namespace std;
10
11THcNPSShowerHit::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
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//
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//
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 //
60 if (fCol != rhs.fCol)
61 return fCol < rhs.fCol;
62 else
63 return fRow < rhs.fRow;
64}
int Int_t
double Double_t
bool operator<(THcNPSShowerHit rhs) const
bool isNeighbour(THcNPSShowerHit *hit1)
Double_t Abs(Double_t d)
STL namespace.