Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JFIT::JFit Class Reference

Data structure for track fit results. More...

#include <JEvt.hh>

Inheritance diagram for JFIT::JFit:
TObject JFIT::JHistory std::vector< JEvent >

Public Member Functions

 JFit ()
 Default constructor. More...
 
 JFit (const JHistory &history, const double x, const double y, const double z, const double dx, const double dy, const double dz, const double t, const double Q, const int NDF, const double E=0.0, const int status=-1)
 Constructor. More...
 
 JFit (const JHistory &history, const double x, const double y, const double z, const int status=-1)
 Constructor for storing position only. More...
 
JFitadd (const JFitApplication_t &type)
 Add event to history. More...
 
double getX () const
 Get X-position. More...
 
double getY () const
 Get Y-position. More...
 
double getZ () const
 Get Z-position. More...
 
double getDX () const
 Get X-slope. More...
 
double getDY () const
 Get Y-slope. More...
 
double getDZ () const
 Get Z-slope. More...
 
double getT () const
 Get time. More...
 
double getQ () const
 Get quality. More...
 
int getNDF () const
 Get number of degrees of freedom. More...
 
double getE () const
 Get energy. More...
 
int getStatus () const
 Get status of the fit; negative values should refer to a bad fit. More...
 
void move (const double step, const double velocity)
 Move vertex along this track with given velocity. More...
 
void setE (const double E)
 Set energy. More...
 
int getN () const
 Get number of values. More...
 
bool hasW (const int i) const
 Check availability of value. More...
 
double getW (const int i) const
 Get value. More...
 
double getW (const int i, const double value) const
 Get value. More...
 
void setW (const int i, const double value)
 Set value. More...
 
 ClassDef (JFit, 5)
 
const JHistorygetHistory () const
 Get history. More...
 
JHistorygetHistory ()
 Get history. More...
 
 ClassDef (JHistory, 1)
 

Protected Attributes

double __x
 
double __y
 
double __z
 
double __dx
 
double __dy
 
double __dz
 
double __t
 
double __Q
 
int __NDF
 
std::vector< double > W
 
double __E
 
int __status
 

Friends

std::ostream & operator<< (std::ostream &out, const JFit &fit)
 Write fit results to output. More...
 

Detailed Description

Data structure for track fit results.

Definition at line 32 of file JEvt.hh.

Constructor & Destructor Documentation

JFIT::JFit::JFit ( )
inline

Default constructor.

Parameters are initialized with non physical values

Definition at line 41 of file JEvt.hh.

41  :
42  __x( -std::numeric_limits<double>::max() ),
43  __y( -std::numeric_limits<double>::max() ),
44  __z( -std::numeric_limits<double>::max() ),
45  __dx(0.0),
46  __dy(0.0),
47  __dz(0.0),
48  __t( -std::numeric_limits<double>::max() ),
49  __Q( -std::numeric_limits<double>::max() ),
50  __NDF(-1),
51  __E(0.0),
52  __status(-1)
53  {}
double __dy
Definition: JEvt.hh:298
int __NDF
Definition: JEvt.hh:302
double __z
Definition: JEvt.hh:296
int __status
Definition: JEvt.hh:305
double __y
Definition: JEvt.hh:295
double __E
Definition: JEvt.hh:304
double __t
Definition: JEvt.hh:300
double __dx
Definition: JEvt.hh:297
double __dz
Definition: JEvt.hh:299
double __Q
Definition: JEvt.hh:301
double __x
Definition: JEvt.hh:294
JFIT::JFit::JFit ( const JHistory history,
const double  x,
const double  y,
const double  z,
const double  dx,
const double  dy,
const double  dz,
const double  t,
const double  Q,
const int  NDF,
const double  E = 0.0,
const int  status = -1 
)
inline

Constructor.

Parameters
historyhistory
xX-position
yY-position
zZ-position
dxX-slope
dyY-slope
dzZ-slope
ttime
Qquality
NDFnumber of degrees of freedom
Eenergy
statusstatus

Definition at line 72 of file JEvt.hh.

83  :
84  JHistory(history)
85  {
86  __x = x;
87  __y = y;
88  __z = z;
89  __dx = dx;
90  __dy = dy;
91  __dz = dz;
92  __t = t;
93  __Q = Q;
94  __NDF = NDF;
95  __E = E;
96  __status = status;
97  }
double __dy
Definition: JEvt.hh:298
int __NDF
Definition: JEvt.hh:302
double __z
Definition: JEvt.hh:296
int __status
Definition: JEvt.hh:305
double __y
Definition: JEvt.hh:295
double __E
Definition: JEvt.hh:304
JHistory()
Default constructor.
Definition: JHistory.hh:182
double __t
Definition: JEvt.hh:300
double __dx
Definition: JEvt.hh:297
double __dz
Definition: JEvt.hh:299
double __Q
Definition: JEvt.hh:301
double __x
Definition: JEvt.hh:294
JFIT::JFit::JFit ( const JHistory history,
const double  x,
const double  y,
const double  z,
const int  status = -1 
)
inline

Constructor for storing position only.

We keep it inside of JFit in order to restrict the ROOT-TObject participation in the software Whether this is related to a Position or a real fit can be obtained via JFitApplication_t

Parameters
historyhistory
xX-position
yY-position
zZ-position
statusstatus

Definition at line 109 of file JEvt.hh.

113  :
114  JHistory(history)
115  {
116  __x = x;
117  __y = y;
118  __z = z;
119  __dx = 0.0;
120  __dy = 0.0;
121  __dz = 0.0;
122  __t = 0.0;
123  __Q = 0.0;
124  __NDF = -1;
125  __E = 0.0;
126  __status = status;
127  }
double __dy
Definition: JEvt.hh:298
int __NDF
Definition: JEvt.hh:302
double __z
Definition: JEvt.hh:296
int __status
Definition: JEvt.hh:305
double __y
Definition: JEvt.hh:295
double __E
Definition: JEvt.hh:304
JHistory()
Default constructor.
Definition: JHistory.hh:182
double __t
Definition: JEvt.hh:300
double __dx
Definition: JEvt.hh:297
double __dz
Definition: JEvt.hh:299
double __Q
Definition: JEvt.hh:301
double __x
Definition: JEvt.hh:294

Member Function Documentation

JFit& JFIT::JFit::add ( const JFitApplication_t type)
inline

Add event to history.

Parameters
typeapplication type
Returns
this fit

Definition at line 136 of file JEvt.hh.

137  {
138  getHistory().add(type);
139 
140  return *this;
141  }
const JHistory & getHistory() const
Get history.
Definition: JHistory.hh:225
JHistory & add(const JFitApplication_t &type)
Add event to history.
Definition: JHistory.hh:248
double JFIT::JFit::getX ( ) const
inline

Get X-position.

Definition at line 144 of file JEvt.hh.

double JFIT::JFit::getY ( ) const
inline

Get Y-position.

Definition at line 145 of file JEvt.hh.

double JFIT::JFit::getZ ( ) const
inline

Get Z-position.

Definition at line 146 of file JEvt.hh.

double JFIT::JFit::getDX ( ) const
inline

Get X-slope.

Definition at line 147 of file JEvt.hh.

double JFIT::JFit::getDY ( ) const
inline

Get Y-slope.

Definition at line 148 of file JEvt.hh.

double JFIT::JFit::getDZ ( ) const
inline

Get Z-slope.

Definition at line 149 of file JEvt.hh.

double JFIT::JFit::getT ( ) const
inline

Get time.

Definition at line 150 of file JEvt.hh.

double JFIT::JFit::getQ ( ) const
inline

Get quality.

Definition at line 151 of file JEvt.hh.

int JFIT::JFit::getNDF ( ) const
inline

Get number of degrees of freedom.

Definition at line 152 of file JEvt.hh.

double JFIT::JFit::getE ( ) const
inline

Get energy.

Definition at line 153 of file JEvt.hh.

int JFIT::JFit::getStatus ( ) const
inline

Get status of the fit; negative values should refer to a bad fit.

Definition at line 154 of file JEvt.hh.

void JFIT::JFit::move ( const double  step,
const double  velocity 
)
inline

Move vertex along this track with given velocity.

Parameters
stepstep
velocityvelocity

Definition at line 163 of file JEvt.hh.

164  {
165  __x += step * __dx;
166  __y += step * __dy;
167  __z += step * __dz;
168  __t += step / velocity;
169  }
double __dy
Definition: JEvt.hh:298
double __z
Definition: JEvt.hh:296
double __y
Definition: JEvt.hh:295
double __t
Definition: JEvt.hh:300
double __dx
Definition: JEvt.hh:297
double __dz
Definition: JEvt.hh:299
double __x
Definition: JEvt.hh:294
void JFIT::JFit::setE ( const double  E)
inline

Set energy.

Parameters
Eenergy

Definition at line 177 of file JEvt.hh.

178  {
179  __E = E;
180  }
double __E
Definition: JEvt.hh:304
int JFIT::JFit::getN ( ) const
inline

Get number of values.

Returns
number of values

Definition at line 188 of file JEvt.hh.

189  {
190  return W.size();
191  }
std::vector< double > W
Definition: JEvt.hh:303
bool JFIT::JFit::hasW ( const int  i) const
inline

Check availability of value.

Parameters
iindex
Returns
true if available; else false

Definition at line 200 of file JEvt.hh.

201  {
202  return (i >= 0 && i < (int) W.size());
203  }
std::vector< double > W
Definition: JEvt.hh:303
double JFIT::JFit::getW ( const int  i) const
inline

Get value.

Parameters
iindex
Returns
value

Definition at line 212 of file JEvt.hh.

213  {
214  return W.at(i);
215  }
std::vector< double > W
Definition: JEvt.hh:303
double JFIT::JFit::getW ( const int  i,
const double  value 
) const
inline

Get value.

Parameters
iindex
valuedefault value
Returns
value

Definition at line 225 of file JEvt.hh.

226  {
227  if (hasW(i))
228  return W.at(i);
229  else
230  return value;
231  }
std::vector< double > W
Definition: JEvt.hh:303
bool hasW(const int i) const
Check availability of value.
Definition: JEvt.hh:200
void JFIT::JFit::setW ( const int  i,
const double  value 
)
inline

Set value.

Parameters
iindex
valuevalue

Definition at line 240 of file JEvt.hh.

241  {
242  if (i >= (int) W.size()) {
243  W.resize(i + 1, 0.0);
244  }
245 
246  W[i] = value;
247  }
std::vector< double > W
Definition: JEvt.hh:303
JFIT::JFit::ClassDef ( JFit  ,
 
)
const JHistory& JFIT::JHistory::getHistory ( ) const
inlineinherited

Get history.

Returns
histtory

Definition at line 225 of file JHistory.hh.

226  {
227  return static_cast<const JHistory&>(*this);
228  }
Container for historical events.
Definition: JHistory.hh:95
JHistory& JFIT::JHistory::getHistory ( )
inlineinherited

Get history.

Returns
histtory

Definition at line 236 of file JHistory.hh.

237  {
238  return static_cast<JHistory&>(*this);
239  }
Container for historical events.
Definition: JHistory.hh:95
JFIT::JHistory::ClassDef ( JHistory  ,
 
)
inherited

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JFit fit 
)
friend

Write fit results to output.

Parameters
outoutput stream
fitfit results
Returns
output stream

Definition at line 257 of file JEvt.hh.

258  {
259  using namespace std;
260 
261  const JHistory& history = fit.getHistory();
262 
263  out << "history:";
264 
265  for (JHistory::const_reverse_iterator i = history.rbegin(); i != history.rend(); ++i) {
266  out << ' ' << i->type;
267  }
268 
269  out << endl;
270 
271  out << "x " << FIXED(7,2) << fit.getX() << endl;
272  out << "y " << FIXED(7,2) << fit.getY() << endl;
273  out << "z " << FIXED(7,2) << fit.getZ() << endl;
274  out << "dx " << FIXED(7,3) << fit.getDX() << endl;
275  out << "dy " << FIXED(7,3) << fit.getDY() << endl;
276  out << "dz " << FIXED(7,3) << fit.getDZ() << endl;
277 
278  out << "Q " << FIXED(12,5) << fit.getQ() << endl;
279  out << "NDF " << setw(5) << fit.getNDF() << endl;
280 
281  out << "status " << fit.getStatus() << endl;
282 
283  for (int i = 0; i != fit.getN(); ++i) {
284  out << "W[" << i << "] = " << FIXED(10,5) << fit.getW(i) << endl;
285  }
286 
287  return out;
288  }
int getNDF() const
Get number of degrees of freedom.
Definition: JEvt.hh:152
int getN() const
Get number of values.
Definition: JEvt.hh:188
Container for historical events.
Definition: JHistory.hh:95
Auxiliary data structure for floating point format specification.
Definition: JPrint.hh:461
double getX() const
Get X-position.
Definition: JEvt.hh:144
double getY() const
Get Y-position.
Definition: JEvt.hh:145
int getStatus() const
Get status of the fit; negative values should refer to a bad fit.
Definition: JEvt.hh:154
double getDZ() const
Get Z-slope.
Definition: JEvt.hh:149
double getQ() const
Get quality.
Definition: JEvt.hh:151
double getZ() const
Get Z-position.
Definition: JEvt.hh:146
double getW(const int i) const
Get value.
Definition: JEvt.hh:212
double getDY() const
Get Y-slope.
Definition: JEvt.hh:148
const JHistory & getHistory() const
Get history.
Definition: JHistory.hh:225
double getDX() const
Get X-slope.
Definition: JEvt.hh:147

Member Data Documentation

double JFIT::JFit::__x
protected

Definition at line 294 of file JEvt.hh.

double JFIT::JFit::__y
protected

Definition at line 295 of file JEvt.hh.

double JFIT::JFit::__z
protected

Definition at line 296 of file JEvt.hh.

double JFIT::JFit::__dx
protected

Definition at line 297 of file JEvt.hh.

double JFIT::JFit::__dy
protected

Definition at line 298 of file JEvt.hh.

double JFIT::JFit::__dz
protected

Definition at line 299 of file JEvt.hh.

double JFIT::JFit::__t
protected

Definition at line 300 of file JEvt.hh.

double JFIT::JFit::__Q
protected

Definition at line 301 of file JEvt.hh.

int JFIT::JFit::__NDF
protected

Definition at line 302 of file JEvt.hh.

std::vector<double> JFIT::JFit::W
protected

Definition at line 303 of file JEvt.hh.

double JFIT::JFit::__E
protected

Definition at line 304 of file JEvt.hh.

int JFIT::JFit::__status
protected

Definition at line 305 of file JEvt.hh.


The documentation for this class was generated from the following file: