StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VertexFinderOptions.cxx
1 #include <iostream>
2 #include <string>
3 
4 #include "StGenericVertexMaker/VertexFinderOptions.h"
5 
6 namespace star_vertex {
7 
8 
9 bool requiresBeamline(VertexFit_t& vertex_fit)
10 {
11  switch(vertex_fit)
12  {
13  case VertexFit_t::BeamlineNoFit:
14  case VertexFit_t::Beamline1D:
15  case VertexFit_t::Beamline3D:
16  return true;
17  default:
18  return false;
19  }
20 }
21 
22 
23 std::istream& operator>>(std::istream &in, VertexFit_t &vertex_fit)
24 {
25  std::string token;
26  in >> token;
27 
28  for (auto & c : token) c = toupper(c);
29 
30  if (token == "NOBEAMLINE")
31  {
32  vertex_fit = VertexFit_t::NoBeamline;
33  }
34  else if (token == "BEAMLINENOFIT")
35  {
36  vertex_fit = VertexFit_t::BeamlineNoFit;
37  }
38  else if (token == "BEAMLINE1D")
39  {
40  vertex_fit = VertexFit_t::Beamline1D;
41  }
42  else if (token == "BEAMLINE3D")
43  {
44  vertex_fit = VertexFit_t::Beamline3D;
45  }
46  else
47  {
48  vertex_fit = VertexFit_t::Unspecified;
49  }
50 
51  return in;
52 }
53 
54 
55 
56 std::istream& operator>>(std::istream &in, SeedFinder_t &seed_finder)
57 {
58  std::string token;
59  in >> token;
60 
61  for (auto & c : token) c = toupper(c);
62 
63  if (token == "MINUITVF")
64  {
65  seed_finder = SeedFinder_t::MinuitVF;
66  }
67  else if (token == "PPVLIKELIHOOD")
68  {
69  seed_finder = SeedFinder_t::PPVLikelihood;
70  }
71  else if (token == "TSPECTRUM")
72  {
73  seed_finder = SeedFinder_t::TSpectrum;
74  }
75  else
76  {
77  seed_finder = SeedFinder_t::Unspecified;
78  }
79 
80  return in;
81 }
82 
83 
84 std::ostream& operator<<(std::ostream &out, const VertexFit_t &vertex_fit)
85 {
86  switch(vertex_fit)
87  {
88  case VertexFit_t::NoBeamline:
89  out << "NoBeamline";
90  break;
91  case VertexFit_t::BeamlineNoFit:
92  out << "BeamlineNoFit";
93  break;
94  case VertexFit_t::Beamline1D:
95  out << "Beamline1D";
96  break;
97  case VertexFit_t::Beamline3D:
98  out << "Beamline3D";
99  break;
100  default:
101  out << "Unspecified";
102  }
103 
104  return out;
105 }
106 
107 
108 std::ostream& operator<<(std::ostream &out, const SeedFinder_t &seed_finder)
109 {
110  switch(seed_finder)
111  {
112  case SeedFinder_t::MinuitVF:
113  out << "MinuitVF";
114  break;
115  case SeedFinder_t::PPVLikelihood:
116  out << "PPVLikelihood";
117  break;
118  case SeedFinder_t::TSpectrum:
119  out << "TSpectrum";
120  break;
121  default:
122  out << "Unspecified";
123  }
124 
125  return out;
126 }
127 
128 }