Hall C ROOT/C++ Analyzer (hcana)
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 
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 }
bool isNeighbour(THcShowerHit *hit1)
int Int_t
STL namespace.
Short_t Abs(Short_t d)
bool operator<(THcShowerHit rhs) const
double Double_t