From ad3ad735194d308ae8a10cb1bd2bf3e96442e1eb Mon Sep 17 00:00:00 2001 From: Vardan Tadevosyan <tadevosn@jlab.org> Date: Mon, 11 Jan 2016 19:14:59 +0400 Subject: [PATCH] Move definitions from THcShowerHitCluster.h into THcShowerHitCluster.cxx. --- SConscript.py | 2 +- src/THcShowerHitCluster.cxx | 54 +++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/THcShowerHitCluster.cxx diff --git a/SConscript.py b/SConscript.py index 7913179..baae720 100644 --- a/SConscript.py +++ b/SConscript.py @@ -17,7 +17,7 @@ hcheaders = Split(""" src/THcDC.h src/THcDriftChamberPlane.h src/THcDriftChamber.h src/THcRawDCHit.h src/THcDCHit.h src/THcDCWire.h src/THcSpacePoint.h src/THcDCLookupTTDConv.h src/THcDCTimeToDistConv.h src/THcShower.h src/THcShowerPlane.h - src/THcShowerArray.h + src/THcShowerArray.h src/THcShowerHitCluster.h src/THcRawShowerHit.h src/THcAerogel.h src/THcAerogelHit.h src/THcCherenkov.h src/THcCherenkovHit.h src/THcGlobals.h src/THcDCTrack.h src/THcFormula.h src/THcRaster.h src/THcRasteredBeam.h src/THcRasterRawHit.h src/THcScalerEvtHandler.h diff --git a/src/THcShowerHitCluster.cxx b/src/THcShowerHitCluster.cxx new file mode 100644 index 0000000..ead20f8 --- /dev/null +++ b/src/THcShowerHitCluster.cxx @@ -0,0 +1,54 @@ +#include "THcShowerHitCluster.h" + +//____________________________________________________________________________ +THcShowerHit::THcShowerHit() { //default constructor + fCol=fRow=0; + fX=fZ=0.; + fE=0.; + fEpos=0.; + fEneg=0.; +} + +//____________________________________________________________________________ +THcShowerHit::THcShowerHit(Int_t hRow, Int_t hCol, Double_t hX, Double_t hZ, + Double_t hE, Double_t hEpos, Double_t hEneg) { + fRow=hRow; + fCol=hCol; + fX=hX; + fZ=hZ; + fE=hE; + fEpos=hEpos; + fEneg=hEneg; +} + +//____________________________________________________________________________ +// Decide if a hit is neighbouring the current hit. +// Two hits are neighbours if share a side or a corner, +// or in the same row but separated by no more than a block. +// +bool THcShowerHit::isNeighbour(THcShowerHit* hit1) { + //Is hit1 neighbouring this hit? + Int_t dRow = fRow-(*hit1).fRow; + Int_t dCol = fCol-(*hit1).fCol; + return (TMath::Abs(dRow)<2 && TMath::Abs(dCol)<2) || + (dRow==0 && TMath::Abs(dCol)<3); +} + +//____________________________________________________________________________ +//Print out hit information +// +void THcShowerHit::show() { + cout << "row=" << fRow << " column=" << fCol + << " x=" << fX << " z=" << fZ + << " E=" << fE << " Epos=" << fEpos << " Eneg=" << fEneg << endl; +} + +//____________________________________________________________________________ +// Define < operator in order to fill in set of hits in a sorted manner. +// +bool THcShowerHit::operator<(THcShowerHit rhs) const { + if (fCol != rhs.fCol) + return fCol < rhs.fCol; + else + return fRow < rhs.fRow; +} -- GitLab