FastJet 3.0alpha3
Public Member Functions
fastjet::GhostedAreaSpec Class Reference

Parameters to configure the computation of jet areas using ghosts. More...

#include <GhostedAreaSpec.hh>

Collaboration diagram for fastjet::GhostedAreaSpec:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GhostedAreaSpec ()
 default constructor
 GhostedAreaSpec (double ghost_maxrap, int repeat=gas::def_repeat, double ghost_area=gas::def_ghost_area, double grid_scatter=gas::def_grid_scatter, double kt_scatter=gas::def_kt_scatter, double mean_ghost_kt=gas::def_mean_ghost_kt)
 explicit constructor
 GhostedAreaSpec (double ghost_minrap, double ghost_maxrap, int repeat=gas::def_repeat, double ghost_area=gas::def_ghost_area, double grid_scatter=gas::def_grid_scatter, double kt_scatter=gas::def_kt_scatter, double mean_ghost_kt=gas::def_mean_ghost_kt)
 explicit constructor
 GhostedAreaSpec (const Selector &selector, int repeat=gas::def_repeat, double ghost_area=gas::def_ghost_area, double grid_scatter=gas::def_grid_scatter, double kt_scatter=gas::def_kt_scatter, double mean_ghost_kt=gas::def_mean_ghost_kt)
 constructor based on a Selector
void _initialize ()
 does the initialization of actual ghost parameters
double ghost_etamax () const
double ghost_maxrap () const
double ghost_area () const
double grid_scatter () const
double kt_scatter () const
double mean_ghost_kt () const
int repeat () const
double actual_ghost_area () const
int n_ghosts () const
void set_ghost_area (double val)
void set_ghost_etamax (double val)
void set_ghost_maxrap (double val)
void set_grid_scatter (double val)
void set_kt_scatter (double val)
void set_mean_ghost_kt (double val)
void set_repeat (int val)
int nphi () const
 return nphi (ghosts layed out (-nrap, 0..nphi-1), (-nrap+1,0..nphi-1), ...
int nrap () const
void get_random_status (std::vector< int > &__iseed) const
 get all relevant information about the status of the random number generator, so that it can be reset subsequently with set_random_status.
void set_random_status (const std::vector< int > &__iseed)
 set the status of the random number generator, as obtained previously with get_random_status.
void checkpoint_random ()
void restore_checkpoint_random ()
std::string description () const
 for a summary
void add_ghosts (std::vector< PseudoJet > &) const
 push a set of ghost 4-momenta onto the back of the vector of PseudoJets
double random_at_own_risk () const
 very deprecated public access to a random number from the internal generator
BasicRandom< double > & generator_at_own_risk () const
 very deprecated public access to the generator itself

Detailed Description

Parameters to configure the computation of jet areas using ghosts.

Class that defines the parameters that go into the measurement of active jet areas.

Definition at line 63 of file GhostedAreaSpec.hh.


Constructor & Destructor Documentation

fastjet::GhostedAreaSpec::GhostedAreaSpec ( const Selector selector,
int  repeat = gas::def_repeat,
double  ghost_area = gas::def_ghost_area,
double  grid_scatter = gas::def_grid_scatter,
double  kt_scatter = gas::def_kt_scatter,
double  mean_ghost_kt = gas::def_mean_ghost_kt 
) [explicit]

constructor based on a Selector

explicit constructor

Definition at line 43 of file GhostedAreaSpec.cc.

References _initialize(), fastjet::Selector::applies_jet_by_jet(), fastjet::Selector::get_rapidity_extent(), and fastjet::Selector::has_finite_area().

                           : 
    _repeat(repeat), 
    _ghost_area(ghost_area), 
    _grid_scatter(grid_scatter),  
    _kt_scatter(kt_scatter), 
    _mean_ghost_kt(mean_ghost_kt),
    _selector(selector),
    _actual_ghost_area(-1.0)
  {
    // check the selector has the properties needed -- an area and
    // applicability jet-by-jet (the latter follows automatically from
    // the former?)
    if (!_selector.has_finite_area()) throw Error("To construct a GhostedAreaSpec with a Selector, the selector must have a finite area");
    if (!_selector.applies_jet_by_jet()) throw Error("To construct a GhostedAreaSpec with a Selector, the selector must apply jet-by-jet");
    // get the internal rapidity extent from the selector
    double ghost_maxrap, ghost_minrap;
    _selector.get_rapidity_extent(ghost_minrap, ghost_maxrap);
    _ghost_maxrap     = 0.5*(ghost_maxrap - ghost_minrap); 
    _ghost_rap_offset = 0.5*(ghost_maxrap + ghost_minrap);
    
    _initialize();
  
}

Member Function Documentation

void fastjet::GhostedAreaSpec::_initialize ( )

does the initialization of actual ghost parameters

sets the detailed parameters for the ghosts (which may not be quite the same as those requested -- this is in order for things to fit in nicely into 2pi etc...

Definition at line 77 of file GhostedAreaSpec.cc.

Referenced by GhostedAreaSpec().

                                  {
  // add on area-measuring dummy particles
  _drap = sqrt(_ghost_area);
  _dphi = _drap;
  _nphi = int(ceil(twopi/_dphi)); _dphi = twopi/_nphi;
  _nrap = int(ceil(_ghost_maxrap/_drap)); _drap = _ghost_maxrap / _nrap;
  _actual_ghost_area = _dphi * _drap;
  _n_ghosts   = (2*_nrap+1)*_nphi;

  // checkpoint the status of the random number generator.
  checkpoint_random();
  //_random_generator.info(cerr);
}
int fastjet::GhostedAreaSpec::nphi ( ) const [inline]

return nphi (ghosts layed out (-nrap, 0..nphi-1), (-nrap+1,0..nphi-1), ...

(nrap,0..nphi-1)

Definition at line 148 of file GhostedAreaSpec.hh.

{return _nphi;}
void fastjet::GhostedAreaSpec::get_random_status ( std::vector< int > &  __iseed) const [inline]

get all relevant information about the status of the random number generator, so that it can be reset subsequently with set_random_status.

Definition at line 154 of file GhostedAreaSpec.hh.

                                                                {
    _random_generator.get_status(__iseed);}
void fastjet::GhostedAreaSpec::set_random_status ( const std::vector< int > &  __iseed) [inline]

set the status of the random number generator, as obtained previously with get_random_status.

Note that the random generator is a static member of the class, i.e. common to all instances of the class --- so if you modify the random for this instance, you modify it for all instances.

Definition at line 162 of file GhostedAreaSpec.hh.

                                                                {
    _random_generator.set_status(__iseed);}
void fastjet::GhostedAreaSpec::add_ghosts ( std::vector< PseudoJet > &  ) const

push a set of ghost 4-momenta onto the back of the vector of PseudoJets

adds the ghost 4-momenta to the vector of PseudoJet's

Definition at line 93 of file GhostedAreaSpec.cc.

References fastjet::SharedPtr< T >::get(), fastjet::Selector::pass(), fastjet::PseudoJet::set_cached_rap_phi(), and fastjet::Selector::worker().

Referenced by fastjet::Selector::area().

                                                                {
  // add momenta for ghosts
  for (int irap = -_nrap; irap <= _nrap; irap++) {
    for (int iphi = 0; iphi < _nphi; iphi++) {
     
      // include random offsets for all quantities
      //----------------------------------------------
      // NB: in FJ2 we'd exchanged the px and py components relative to a
      // standard definition of phi; to preserve the same areas as fj2
      // we now generate a "phi_fj2", and then convert to a standard phi
      double phi_fj2 = (iphi+0.5) * _dphi + _dphi*(_our_rand()-0.5)*_grid_scatter;
      double phi = 0.5*pi - phi_fj2;
      double rap = irap * _drap + _drap*(_our_rand()-0.5)*_grid_scatter
                                                         + _ghost_rap_offset ;
      double kt = _mean_ghost_kt*(1+(_our_rand()-0.5)*_kt_scatter);

      double exprap = exp(+rap);
      double pminus = kt/exprap;
      double pplus  = kt*exprap;
      double px = kt*cos(phi);
      double py = kt*sin(phi);
      PseudoJet mom(px,py,0.5*(pplus-pminus),0.5*(pplus+pminus));
      // this call fills in the PseudoJet's cached rap,phi information,
      // based on pre-existing knowledge. Watch out: if you get the hint
      // wrong nobody will tell you, but you will certainly mess up
      // your results.
      mom.set_cached_rap_phi(rap,phi);

      // if we have an active selector and the particle does not pass the 
      // selection condition, move on to the next momentum
      if (_selector.worker().get() && !_selector.pass(mom)) continue;
      event.push_back(mom);
    }
  }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends