Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcShowerHit.cxx
Go to the documentation of this file.
1
5#include "THcShowerHit.h"
6
7//ClassImp(THcShowerHit)
8
9using namespace std;
10
11THcShowerHit::THcShowerHit() { //default constructor
12 fCol=fRow=0;
13 fX=fY=fZ=0.;
14 fE=0.;
15 fEpos=0.;
16 fEneg=0.;
17}
18
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//
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//
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 //
57 if (fCol != rhs.fCol)
58 return fCol < rhs.fCol;
59 else
60 return fRow < rhs.fRow;
61}
int Int_t
double Double_t
bool operator<(THcShowerHit rhs) const
Double_t fZ
Double_t fEpos
bool isNeighbour(THcShowerHit *hit1)
Double_t fEneg
Double_t fY
Double_t fX
Double_t fE
Double_t Abs(Double_t d)
STL namespace.