Newer
Older
Simon Zhamkochyan
committed
#ifndef ROOT_THcShowerHit
#define ROOT_THcShowerHit
// HMS calorimeter hits, version 2
Simon Zhamkochyan
committed
#include <vector>
#include <iterator>
#include <iostream>
using namespace std;
class THcShowerHit { //HMS calorimeter hit class
Int_t fCol, fRow; //hit colomn and row
Double_t fX, fZ; //hit X (vert.) and Z (along spect.axis) coordinates
Double_t fE; //hit mean energy deposition
Double_t fEpos; //hit energy deposition from positive PMT
Double_t fEneg; //hit energy deposition from negative PMT
Simon Zhamkochyan
committed
THcShowerHit() { //default constructor
fEpos=0.;
fEneg=0.;
Simon Zhamkochyan
committed
}
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;
fEpos=hEpos;
fEneg=hEneg;
Simon Zhamkochyan
committed
~THcShowerHit() {
// cout << " hit destructed" << endl;
}
Simon Zhamkochyan
committed
Simon Zhamkochyan
committed
Simon Zhamkochyan
committed
Double_t hitX() {
Simon Zhamkochyan
committed
Double_t hitZ() {
Simon Zhamkochyan
committed
Double_t hitE() {
Double_t hitEpos() {
return fEpos;
}
Double_t hitEneg() {
return fEneg;
}
// Decide if a hit is neighbouring the current hit.
// Two hits are neighbours if share a side or a corner.
//
bool isNeighbour(THcShowerHit* hit1) { //Is hit1 neighbouring this hit?
Stephen A. Wood
committed
Int_t dRow = fRow-(*hit1).fRow;
Int_t dCol = fCol-(*hit1).fCol;
return TMath::Abs(dRow)<2 && TMath::Abs(dCol)<2;
}
//Print out hit information
//
void show() {
//cout << "row=" << fRow << " column=" << fCol
// << " x=" << fX << " z=" << fZ
// << " E=" << fE << " Epos=" << fEpos << " Eneg=" << fEneg << endl;
// Container (collection) of hits and its iterator.
typedef vector<THcShowerHit*> THcShowerHitList;
typedef THcShowerHitList::iterator THcShowerHitIt;