//* $Id: */ // ------------------------------------------------------------------------- // ----- CbmMvdStripsDigiMatch source file ----- // ----- Created 31/08/06 by V. Friese ----- // ------------------------------------------------------------------------- #include "CbmMvdStripsDigiMatch.h" #include using std::cout; using std::endl; // ----- Default onstructor -------------------------------------------- CbmMvdStripsDigiMatch::CbmMvdStripsDigiMatch() { fRefIndex[0] = fRefIndex[1] = fRefIndex[2] = -1; }; // ------------------------------------------------------------------------- // ----- Standard constructor ------------------------------------------ CbmMvdStripsDigiMatch::CbmMvdStripsDigiMatch(Int_t iPoint) { if ( iPoint < 0 && iPoint != -666 ) { cout << "-W- CbmMvdStripsDigiMatch: Illegal MvdStripsPoint index " << iPoint << endl; fRefIndex[0] = -1; } else fRefIndex[0] = iPoint; fRefIndex[1] = fRefIndex[2] = -1; }; // ------------------------------------------------------------------------- // ----- Destructor ---------------------------------------------------- CbmMvdStripsDigiMatch::~CbmMvdStripsDigiMatch() { }; // ------------------------------------------------------------------------- // ----- Public method AddPoint ---------------------------------------- Int_t CbmMvdStripsDigiMatch::AddPoint(Int_t iPoint) { if ( iPoint < 0 ) { cout << "-W- CbmMvdStripsDigiMatch::AddPoint: Illegal MvdStripsPoint index " << iPoint << endl; return 0; } for (Int_t i=0; i<3; i++) { if ( fRefIndex[i] == -1 ) { fRefIndex[i] = iPoint; return i+1; } } return 4; } // ------------------------------------------------------------------------- // ----- Public method GetRefIndex ------------------------------------- Int_t CbmMvdStripsDigiMatch::GetRefIndex(Int_t i) const { if ( i<0 || i>2 ) { cout << "-W- CbmMvdStripsDigiMatch::GetRefIndex: Illegal index number " << i << endl; return -1; } return fRefIndex[i]; } // ------------------------------------------------------------------------- ClassImp(CbmMvdStripsDigiMatch)