CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

hitfit::Fourvec_Event Class Reference

Represent an event for kinematic fitting as a collection of four-momenta. Each object is represented as an instance of FE_Obj. There may be an object for a neutrino. If that is the case, it is always at the end of the object list. It is not included in the count returned by nobjs(). But is is included in nobjs_all(). More...

#include <Fourvec_Event.h>

List of all members.

Public Member Functions

void add (const FE_Obj &obj)
 Add an object to the event. The object should not be a neutrino, use the method set_nu_p for that.
 Fourvec_Event ()
 Default constructor.
bool has_neutrino () const
 Return TRUE is this event contains a neutrino, otherwise returns FALSE.
const Fourveckt () const
 Access the $k_{T}$ four-momentum.
double kt_x_error () const
 Return the x uncertainty in $k_{T}$.
double kt_xy_covar () const
 Return the xy covariance in $k_{T}$.
double kt_y_error () const
 Return the y uncertainty in $k_{T}$.
int nobjs () const
 Return the number of objects in the event not including any neutrinos.
int nobjs_all () const
 Return the number of objects in the event including any neutrinos.
const Fourvecnu () const
 Access the neutrino four-momentum.
const FE_Objobj (std::vector< FE_Obj >::size_type i) const
 Access object at index i, with the convention that the index starts at 0.
void set_kt_error (double kt_x_error, double kt_y_error, double kt_xy_covar)
 Set the uncertainties on $k_{T}$.
void set_nu_p (const Fourvec &p)
 Set the neutrino four-momentum to $p$. This method adds a neutrino if there wasn't already one.
void set_obj_p (std::vector< FE_Obj >::size_type i, const Fourvec &p)
 Set the four-momentum of object at index i to $p$.
void set_x_p (const Fourvec &p)
 Set the four-momentum of the $x$ object.
const Fourvecx () const
 Access the $x$ four-momentum.

Private Attributes

bool _has_neutrino
Fourvec _kt
double _kt_x_error
double _kt_xy_covar
double _kt_y_error
std::vector< FE_Obj_objs
Fourvec _x

Friends

std::ostream & operator<< (std::ostream &s, const Fourvec_Event &fe)
 Output stream operator, print the content of this Fourvec_Event object to an output stream.

Detailed Description

Represent an event for kinematic fitting as a collection of four-momenta. Each object is represented as an instance of FE_Obj. There may be an object for a neutrino. If that is the case, it is always at the end of the object list. It is not included in the count returned by nobjs(). But is is included in nobjs_all().

We can also record the other $x$ momentum, that will be added into the $k_{T}$ sum. This can be used to store a missing transverse energy that is not attributed to a neutrino but is instead due to mismeasurement. Typically this will be set to zero in events that have a neutrino, and to the measured missing transverse energy in events that do not.

Definition at line 202 of file Fourvec_Event.h.


Constructor & Destructor Documentation

hitfit::Fourvec_Event::Fourvec_Event ( )

Default constructor.

Definition at line 112 of file Fourvec_Event.cc.

  : _kt_x_error (0),
    _kt_y_error (0),
    _kt_xy_covar (0),
    _has_neutrino (false)
{
}

Member Function Documentation

void hitfit::Fourvec_Event::add ( const FE_Obj obj)

Add an object to the event. The object should not be a neutrino, use the method set_nu_p for that.

Parameters:
objThe FE_Obj to add.

Definition at line 268 of file Fourvec_Event.cc.

References _has_neutrino, _kt, _objs, hitfit::FE_Obj::label, hitfit::nu_label, obj(), and hitfit::FE_Obj::p.

{
  assert (obj.label != nu_label);

  // Add to the end of the list, but before any neutrino.
  if (_has_neutrino) {
    assert (_objs.size() > 0);
    _objs.insert (_objs.begin() + _objs.size() - 1, obj);
  }
  else
    _objs.push_back (obj);

  // Maintain kt.
  _kt += obj.p;
}
bool hitfit::Fourvec_Event::has_neutrino ( ) const

Return TRUE is this event contains a neutrino, otherwise returns FALSE.

Definition at line 124 of file Fourvec_Event.cc.

References _has_neutrino.

Referenced by hitfit::Fourvec_Constrainer::constrain(), and hitfit::Fourvec_Constraint_Calculator::eval().

{
  return _has_neutrino;
}
const Fourvec & hitfit::Fourvec_Event::kt ( ) const

Access the $k_{T}$ four-momentum.

Definition at line 184 of file Fourvec_Event.cc.

References _kt.

{
  return _kt;
}
double hitfit::Fourvec_Event::kt_x_error ( ) const

Return the x uncertainty in $k_{T}$.

Definition at line 202 of file Fourvec_Event.cc.

References _kt_x_error.

Referenced by set_kt_error().

{
  return _kt_x_error;
}
double hitfit::Fourvec_Event::kt_xy_covar ( ) const

Return the xy covariance in $k_{T}$.

Definition at line 226 of file Fourvec_Event.cc.

References _kt_xy_covar.

Referenced by set_kt_error().

{
  return _kt_xy_covar;
}
double hitfit::Fourvec_Event::kt_y_error ( ) const

Return the y uncertainty in $k_{T}$.

Definition at line 214 of file Fourvec_Event.cc.

References _kt_y_error.

Referenced by set_kt_error().

{
  return _kt_y_error;
}
int hitfit::Fourvec_Event::nobjs ( ) const

Return the number of objects in the event not including any neutrinos.

Definition at line 136 of file Fourvec_Event.cc.

References _has_neutrino, and _objs.

Referenced by hitfit::Fourvec_Constrainer::constrain(), and hitfit::Fourvec_Constraint_Calculator::eval().

{
  return _objs.size() - (_has_neutrino ? 1 : 0);
}
int hitfit::Fourvec_Event::nobjs_all ( ) const

Return the number of objects in the event including any neutrinos.

Definition at line 149 of file Fourvec_Event.cc.

References _objs.

Referenced by hitfit::Pair_Table::Pair_Table().

{
  return _objs.size();
}
const Fourvec & hitfit::Fourvec_Event::nu ( ) const

Access the neutrino four-momentum.

Definition at line 174 of file Fourvec_Event.cc.

References _has_neutrino, and _objs.

{
  assert (_has_neutrino);
  return _objs.back().p;
}
const FE_Obj & hitfit::Fourvec_Event::obj ( std::vector< FE_Obj >::size_type  i) const

Access object at index i, with the convention that the index starts at 0.

Parameters:
iThe index of the desired object.

Definition at line 161 of file Fourvec_Event.cc.

References i.

Referenced by add(), and hitfit::Pair_Table::Pair_Table().

{
  assert (i < _objs.size ());
  return _objs[i];
}
void hitfit::Fourvec_Event::set_kt_error ( double  kt_x_error,
double  kt_y_error,
double  kt_xy_covar 
)

Set the uncertainties on $k_{T}$.

Parameters:
kt_x_errorThe uncertainty in the $x-$component of $k_{T}$.
kt_y_errorThe uncertainty in the $y-$component of $k_{T}$.
kt_xy_covarThe covariance between the $x-$ and $y-$component of $k_{T}$.

Definition at line 344 of file Fourvec_Event.cc.

References _kt_x_error, _kt_xy_covar, _kt_y_error, kt_x_error(), kt_xy_covar(), and kt_y_error().

void hitfit::Fourvec_Event::set_nu_p ( const Fourvec p)

Set the neutrino four-momentum to $p$. This method adds a neutrino if there wasn't already one.

Parameters:
pThe new four-momentum of the neutrino.

Definition at line 292 of file Fourvec_Event.cc.

References _has_neutrino, _kt, _objs, hitfit::nu_label, and AlCaHLTBitMon_ParallelJobs::p.

{
  if (_has_neutrino) {
    _kt -= _objs.back().p;
    _objs.back().p = p;
  }
  else {
    _has_neutrino = true;
    _objs.push_back (FE_Obj (p, 0, nu_label, 0, 0, 0, false));
  }

  _kt += p;
}
void hitfit::Fourvec_Event::set_obj_p ( std::vector< FE_Obj >::size_type  i,
const Fourvec p 
)

Set the four-momentum of object at index i to $p$.

Parameters:
iThe position index of the object to change.
pThe new four-momentum of object at index i.

Definition at line 314 of file Fourvec_Event.cc.

References _kt, _objs, i, and AlCaHLTBitMon_ParallelJobs::p.

{
  assert (i < _objs.size ());
  _kt -= _objs[i].p;
  _objs[i].p = p;
  _kt += p;
}
void hitfit::Fourvec_Event::set_x_p ( const Fourvec p)

Set the four-momentum of the $x$ object.

Parameters:
pThe new four-momentum of the $x$ object.

Definition at line 330 of file Fourvec_Event.cc.

References _kt, _x, and AlCaHLTBitMon_ParallelJobs::p.

{
  _kt -= _x;
  _x = p;
  _kt += p;
}
const Fourvec & hitfit::Fourvec_Event::x ( ) const

Access the $x$ four-momentum.

Definition at line 193 of file Fourvec_Event.cc.

References _x.

{
  return _x;
}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const Fourvec_Event fe 
) [friend]

Output stream operator, print the content of this Fourvec_Event object to an output stream.

Parameters:
sThe stream to which to write.
feThe instance of Fourvec_Event to be printed.

Definition at line 246 of file Fourvec_Event.cc.

{
  s << "kt: (" << fe._kt.x() << ", " << fe._kt.y() << "); "
    << " error: " << fe._kt_x_error << " " << fe._kt_y_error << " "
    << fe._kt_xy_covar << "\n";
  s << "x: " << fe._x << "\n";
  for (unsigned i = 0; i < fe._objs.size(); i++)
    s << i+1 << ": " << fe._objs[i];
  return s;
}

Member Data Documentation

Flag that a neutrino has been added to the event.

Definition at line 385 of file Fourvec_Event.h.

Referenced by add(), has_neutrino(), nobjs(), nu(), and set_nu_p().

Cached $k_{T}$, this should always be equal to the sum of all the object momenta, including $x$.

Definition at line 358 of file Fourvec_Event.h.

Referenced by add(), kt(), hitfit::operator<<(), set_nu_p(), set_obj_p(), and set_x_p().

The uncertainty in the $x-$component of $k_{T}$.

Definition at line 369 of file Fourvec_Event.h.

Referenced by kt_x_error(), hitfit::operator<<(), and set_kt_error().

The covariance between the $x-$ and $y-$component of $k_{T}$.

Definition at line 379 of file Fourvec_Event.h.

Referenced by kt_xy_covar(), hitfit::operator<<(), and set_kt_error().

The uncertainty in the $y-$component of $k_{T}$.

Definition at line 373 of file Fourvec_Event.h.

Referenced by kt_y_error(), hitfit::operator<<(), and set_kt_error().

std::vector<FE_Obj> hitfit::Fourvec_Event::_objs [private]

The list of contained objects in the event.

Definition at line 350 of file Fourvec_Event.h.

Referenced by add(), nobjs(), nobjs_all(), nu(), hitfit::operator<<(), set_nu_p(), and set_obj_p().

Four-momentum of the $x$ object.

Definition at line 364 of file Fourvec_Event.h.

Referenced by hitfit::operator<<(), set_x_p(), and x().