er  dev
ERmuSiVertex.cxx
1 #include "ERmuSiVertex.h"
2 
3 #include<iostream>
4 
5 
6 ERmuSiVertex::ERmuSiVertex():
7  fTracksNb(0)
8 {
9 
10 }
11 
12 ERmuSiVertex::ERmuSiVertex(Float_t x, Float_t y, Float_t z):
13  fTracksNb(0), fX(x), fY(y), fZ(z)
14 {
15 
16 }
17 
18 void ERmuSiVertex::AddTrack(Int_t id){
19  Bool_t founded = kFALSE;
20  for (Int_t iTrack = 0; iTrack < fTracksNb; iTrack++){
21  if (fTracksID[iTrack] == id){
22  founded = kTRUE;
23  }
24  }
25  if (fTracksNb < 3){
26  if (!founded)
27  fTracksID[fTracksNb++] = id;
28  }
29 
30  if (fTracksNb > 3){
31  std::cerr << "Big track count in vertex!" << std::endl;
32  }
33 }
34 
35 Int_t ERmuSiVertex::Track(Int_t id) const{
36  if (id >= fTracksNb){
37  std::cerr << "There is no such number of tracks!" << std::endl;
38  }
39  return fTracksID[id];
40 }
41