BmnRoot
Loading...
Searching...
No Matches
CbmStsDigiMatch.cxx
Go to the documentation of this file.
1//* $Id: */
2
3// -------------------------------------------------------------------------
4// ----- CbmStsDigiMatch source file -----
5// ----- Created 31/08/06 by V. Friese -----
6// -------------------------------------------------------------------------
7
8#include "CbmStsDigiMatch.h"
9
10#include <iostream>
11
12using std::cout;
13using std::endl;
14
15
16// ----- Default onstructor --------------------------------------------
18 fRefIndex[0] = fRefIndex[1] = fRefIndex[2] = -1;
19};
20
21// -------------------------------------------------------------------------
22
23
24
25// ----- Standard constructor ------------------------------------------
27 if ( iPoint < 0 && iPoint != -666 ) {
28 cout << "-W- CbmStsDigiMatch: Illegal StsPoint index "
29 << iPoint << endl;
30 fRefIndex[0] = -1;
31 }
32 else fRefIndex[0] = iPoint;
33 fRefIndex[1] = fRefIndex[2] = -1;
34};
35// -------------------------------------------------------------------------
36
37
38
39// ----- Destructor ----------------------------------------------------
41// -------------------------------------------------------------------------
42
43
44
45// ----- Public method AddPoint ----------------------------------------
46Int_t CbmStsDigiMatch::AddPoint(Int_t iPoint) {
47 if ( iPoint < 0 ) {
48 cout << "-W- CbmStsDigiMatch::AddPoint: Illegal StsPoint index "
49 << iPoint << endl;
50 return 0;
51 }
52 for (Int_t i=0; i<3; i++) {
53 if ( fRefIndex[i] == -1 ) {
54 fRefIndex[i] = iPoint;
55 return i+1;
56 }
57 }
58 return 4;
59}
60// -------------------------------------------------------------------------
61
62
63
64// ----- Public method GetRefIndex -------------------------------------
65Int_t CbmStsDigiMatch::GetRefIndex(Int_t i) const {
66 if ( i<0 || i>2 ) {
67 cout << "-W- CbmStsDigiMatch::GetRefIndex: Illegal index number "
68 << i << endl;
69 return -1;
70 }
71 return fRefIndex[i];
72}
73// -------------------------------------------------------------------------
int i
Definition P4_F32vec4.h:22
virtual ~CbmStsDigiMatch()
Int_t GetRefIndex(Int_t i=0) const
Int_t AddPoint(Int_t iPoint)