Skip to content
Snippets Groups Projects
  • Vardan Tadevosyan's avatar
    c30c06cf
    Small Shower Calorimeter corrections, chagnes and cleanups · c30c06cf
    Vardan Tadevosyan authored
    Make matched cluster variables of the array part of calorimeter private.
    
    Initialize fY variable in the THcShowerHit::THcShowerHit default
    constructor.
    
    Correct typo in THcShowerArray::Clear, assign -1000 to fMatchClY.
    
    Edit debug output in THcShowerArray::CoarseProcess and remove obsolete
    comments THcShowerArray::MatchCluster.
    
    Clear fSizeClustArray and fNblockHighEnergy quantitites in
    THcShower::Clear, for just in case.
    c30c06cf
    History
    Small Shower Calorimeter corrections, chagnes and cleanups
    Vardan Tadevosyan authored
    Make matched cluster variables of the array part of calorimeter private.
    
    Initialize fY variable in the THcShowerHit::THcShowerHit default
    constructor.
    
    Correct typo in THcShowerArray::Clear, assign -1000 to fMatchClY.
    
    Edit debug output in THcShowerArray::CoarseProcess and remove obsolete
    comments THcShowerArray::MatchCluster.
    
    Clear fSizeClustArray and fNblockHighEnergy quantitites in
    THcShower::Clear, for just in case.
THcShowerHit.cxx 1.58 KiB
/** \classTHcShowerHit
    \ingroup DetSupport

*/
#include "THcShowerHit.h"

//ClassImp(THcShowerHit)

using namespace std;

THcShowerHit::THcShowerHit() {         //default constructor
  fCol=fRow=0;
  fX=fY=fZ=0.;
  fE=0.;
  fEpos=0.;
  fEneg=0.;
}

THcShowerHit::THcShowerHit(Int_t hRow, Int_t hCol, Double_t hX, Double_t hY, Double_t hZ,
			   Double_t hE, Double_t hEpos, Double_t hEneg) {
  fRow=hRow;
  fCol=hCol;
  fX=hX;
  fY=hY;
  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+1 << "  column=" << fCol+1
       << "  x=" << fX  << "  y=" << fY << "  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;
}