StFms  0.0.0
FMS software in the STAR framework
StFmsTower.cxx
Go to the documentation of this file.
1 // $Id$
2 //
3 // $Log$
14 
15 #include "StEvent/StFmsHit.h"
17 
18 namespace FMSCluster {
20  : mHit(NULL), mColumn(-1), mRow(-1), mCluster(-1) { }
21 
22 StFmsTower::StFmsTower(StFmsHit* fmsHit)
23  : mHit(fmsHit), mColumn(-1), mRow(-1), mCluster(-1) { }
24 
26 
28  if (!mHit || !database) { // Check for invalid input
29  return false;
30  } // if
31  // Get row and column from the database
32  mRow = database->getRowNumber(mHit->detectorId(), mHit->channel());
33  mColumn = database->getColumnNumber(mHit->detectorId(), mHit->channel());
34  return mRow > -1 && mColumn > -1;
35 }
36 
37 Bool_t StFmsTower::isNeighbor(const StFmsTower& other) const {
38  return abs(mColumn - other.column()) + abs(mRow - other.row()) == 1;
39 }
40 } // namespace FMSCluster
Int_t mRow
Row number, starts at 1, vertical (STAR y-coord)
Definition: StFmsTower.h:93
Declaration of StFmsTower, a simple FMS tower wrapper.
Int_t column() const
Definition: StFmsTower.h:82
Int_t getColumnNumber(Int_t detectorId, Int_t ch)
get the row number for the channel
Bool_t initialize(StFmsDbMaker *database)
Definition: StFmsTower.cxx:27
Int_t getRowNumber(Int_t detectorId, Int_t ch)
maximum number of channels
Bool_t isNeighbor(const StFmsTower &tower) const
Definition: StFmsTower.cxx:37
Int_t mColumn
Column number, starts at 1, horizontal (STAR x-coord)
Definition: StFmsTower.h:92
Int_t row() const
Definition: StFmsTower.h:84
const StFmsHit * mHit
Hit information, not owned by StFmsTower.
Definition: StFmsTower.h:91