Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Related Pages

SctFitter::Fitter Class Reference

Class definition of the SCT fitting service. More...

#include <Fitter.h>

Collaboration diagram for SctFitter::Fitter:

Collaboration graph
[legend]

Public Member Functions

void go () throw (IsException)
 The command to start the workers.

FitStrategyinternal_getFitStrategy () const throw (LogicError)
 get the strategy. Throws an error if none is defined.

virtual char * status () throw ()
 As for getStatus, but available over IPC.

char * lastScan () throw ()
 Get the name of the last scan which was fitted over ipc;.

virtual char * getFitOptions () throw ()
 Finds the FitStrategy options.

virtual char * getFitStrategy () throw ()
 Finds the FitStrategy name.

virtual void setFitOptions (const char *opt) throw ()
 as for setFitOptions, but over IPC.

virtual void setFitStrategy (const char *strategy) throw ()
 set the fit option over IPC.

void fitAll () throw ()
void fit (const char *name) throw ()
 Fit a named RawScanResult from IS.

long busy ()
 number of busy workers

long queueLength ()
 number of jobs in the queue

long nFitsDone () throw ()
 returns the number of fits done so far over ipc;

long nFitErrors () throw ()
 returns the number of fit errors so far over ipc;

void useAnalyticAlgorithm (CORBA::Boolean use)
 Determine whether to use the analytic fit algorithm.

CORBA::Boolean isUsingAnalyticAlgorithm ()
 Return true if we're using analytic fit algorithms.

void setFifo (bool)
 set true for FIFO, false for FILO - see WorkerGroup for pros and cons!

bool isFifo ()
 set true for FIFO, false for FILO - see WorkerGroup for pros and cons!

void incrementFitErrors () throw ()
 Increments the number of fit errors by 1.

void incrementFitsDone () throw ()
 Increments the number of fits done by 1.

void scanDone (double time) throw ()
 Called by the workers to add to the total amount of scan time.

void addIOTime (double time) throw ()
 Called to add to IO time.

double getAverageTimePerScan () const throw ()
 Algorithm may be complex! Check actual code.

std::string getOutputIsServer () const
 Server to write fits to...


Static Public Member Functions

Fitterinstance ()
 Gets a reference to the instance of the Fitter.

Fitterinitialize (FitterArguments args) throw (ConfigurationException)
 Initialize the Fitter instance.

IPCServer & getFitterServer () throw ()
 Get the Fitter IPC server.


Private Member Functions

void shutdown ()
 The following method is a new requirement of IPCNamedObjects under the omni-orb.

 Fitter (FitterArguments args) throw (ConfigurationException)
 singleton

 ~Fitter () throw ()
 private destructor

const char * internal_status () const throw ()
 Get the status information.

const char * internal_lastScan () const throw ()
 Get the name of the last scan which was fitted;.

void internal_setFitOptions (const string &opt) throw (LogicError)
void internal_setFitStrategy (const string &name) throw (LogicError)
 Set the stragegy from a name the the FitStrategy map.

long internal_nFitsDone () const throw ()
 returns the number of fits done so far;

long internal_nFitErrors () const throw ()
 returns the number of fit errors so far;

bool internal_isUsingAnalyticAlgorithm () const
 Return true if we're using analytic fit algorithms.

void setLastScanName (const std::string &name)
 update record of last scan attempted.

void updateSubscriptions ()

Static Private Member Functions

void doFits (ISCallbackInfo *isc) throw (IsException, LogicError)
 The infoReceiver callback function must take a static function as an argument.


Private Attributes

long m_nFitsDone
long m_nFitErrors
long m_nScans
double m_scanTimeTaken
double m_ioTimeTaken
boost::recursive_mutex counterMutex
 Used to lock access to all the counters.

string m_scan
string m_status
 pointer to char containing the status: cached so that we don't have to make lots of char*'s.

FitStrategym_fitStrategy
 Pointer to the fit strategy.

FitterWorkerGroupworkergroup
 Group of workers which do the actual fitting.

std::auto_ptr< ISInfoReceiver > m_infoReceiver
 An InfoReveiver for RawRODData objects.

FitterArguments m_args

Static Private Attributes

Fitterfitter

Friends

class FitterWorkerGroup
 FitterWorker is allowed to update stuff.


Detailed Description

Class definition of the SCT fitting service.

This service subscribes to an input IS server, receiving new RawScanResult objects. It then fits a function (dependant on the ScanType) to chips, strips, etc. and outputs a FitScanResult object to the output IS server.
Some status information about the Fitter is available via IPC request.

Author:
Alan Barr
Date:
16 December 2002

Definition at line 41 of file Fitter.h.


Constructor & Destructor Documentation

SctFitter::Fitter::Fitter FitterArguments  args  )  throw (ConfigurationException) [private]
 

singleton

Definition at line 47 of file Fitter.cpp.

SctFitter::Fitter::~Fitter  )  throw () [private]
 

private destructor

Definition at line 75 of file Fitter.cpp.


Member Function Documentation

void SctFitter::Fitter::addIOTime double  time  )  throw ()
 

Called to add to IO time.

Assumes that main thread does IO and is running concurrently with workers.

Definition at line 308 of file Fitter.cpp.

long SctFitter::Fitter::busy  ) 
 

number of busy workers

Definition at line 351 of file Fitter.cpp.

References SctService::WorkerGroup< string >::busy(), counterMutex, and workergroup.

Here is the call graph for this function:

void SctFitter::Fitter::doFits ISCallbackInfo *  isc  )  throw (IsException, LogicError) [static, private]
 

The infoReceiver callback function must take a static function as an argument.

This function simply calls doFits on the parameter or `rock', which is set to be `this' (Fitter).
At the moment it catches all errors since I think it should still be in a stable state after most logic errors I can think of. AJB

Definition at line 125 of file Fitter.cpp.

References SctService::WorkerGroup< string >::push(), and workergroup.

Here is the call graph for this function:

void SctFitter::Fitter::fit const char *  name  )  throw ()
 

Fit a named RawScanResult from IS.

Definition at line 135 of file Fitter.cpp.

double SctFitter::Fitter::getAverageTimePerScan  )  const throw ()
 

Algorithm may be complex! Check actual code.

Definition at line 314 of file Fitter.cpp.

char * SctFitter::Fitter::getFitOptions  )  throw () [virtual]
 

Finds the FitStrategy options.

Makes a new char[] which ipc then deletes.

Definition at line 171 of file Fitter.cpp.

char * SctFitter::Fitter::getFitStrategy  )  throw () [virtual]
 

Finds the FitStrategy name.

Makes a new char[] which ipc then deletes.

Definition at line 230 of file Fitter.cpp.

IPCServer & SctFitter::Fitter::getFitterServer  )  throw () [static]
 

Get the Fitter IPC server.

Definition at line 82 of file Fitter.cpp.

Referenced by shutdown().

std::string SctFitter::Fitter::getOutputIsServer  )  const
 

Server to write fits to...

Definition at line 78 of file Fitter.cpp.

References SctService::Arguments::getOutputISServer().

Here is the call graph for this function:

void SctFitter::Fitter::go  )  throw (IsException)
 

The command to start the workers.

Definition at line 89 of file Fitter.cpp.

void SctFitter::Fitter::incrementFitErrors  )  throw ()
 

Increments the number of fit errors by 1.

Definition at line 292 of file Fitter.cpp.

Referenced by SctFitter::FitAlgorithm::doFit().

void SctFitter::Fitter::incrementFitsDone  )  throw ()
 

Increments the number of fits done by 1.

Definition at line 297 of file Fitter.cpp.

Referenced by SctFitter::FitAlgorithm::doFit().

Fitter & SctFitter::Fitter::initialize FitterArguments  args  )  throw (ConfigurationException) [static]
 

Initialize the Fitter instance.

Parameters:
fitStrategyName the name of the FitStrategy to use. Default is RootFitStrategy
Exceptions:
ConfigurationException if the fitStrategyName is not a recognized FitStrategy

Definition at line 37 of file Fitter.cpp.

Fitter & SctFitter::Fitter::instance  )  [static]
 

Gets a reference to the instance of the Fitter.

If it hasn't been initialized, it calls initialize() first

Definition at line 31 of file Fitter.cpp.

FitStrategy & SctFitter::Fitter::internal_getFitStrategy  )  const throw (LogicError)
 

get the strategy. Throws an error if none is defined.

Definition at line 377 of file Fitter.cpp.

Referenced by SctFitter::FitAlgorithm::doFit().

bool SctFitter::Fitter::internal_isUsingAnalyticAlgorithm  )  const [private]
 

Return true if we're using analytic fit algorithms.

Definition at line 219 of file Fitter.cpp.

References counterMutex.

Referenced by isUsingAnalyticAlgorithm().

const char * SctFitter::Fitter::internal_lastScan  )  const throw () [private]
 

Get the name of the last scan which was fitted;.

Definition at line 356 of file Fitter.cpp.

long SctFitter::Fitter::internal_nFitErrors  )  const throw () [private]
 

returns the number of fit errors so far;

Definition at line 327 of file Fitter.cpp.

long SctFitter::Fitter::internal_nFitsDone  )  const throw () [private]
 

returns the number of fits done so far;

Definition at line 322 of file Fitter.cpp.

void SctFitter::Fitter::internal_setFitStrategy const string &  name  )  throw (LogicError) [private]
 

Set the stragegy from a name the the FitStrategy map.

Exceptions:
LogicError if that name is not in the map.

Definition at line 384 of file Fitter.cpp.

const char * SctFitter::Fitter::internal_status  )  const throw () [private]
 

Get the status information.

Definition at line 259 of file Fitter.cpp.

bool SctFitter::Fitter::isFifo  ) 
 

set true for FIFO, false for FILO - see WorkerGroup for pros and cons!

Definition at line 369 of file Fitter.cpp.

References SctService::WorkerGroup< string >::isFifo(), and workergroup.

Here is the call graph for this function:

CORBA::Boolean SctFitter::Fitter::isUsingAnalyticAlgorithm  ) 
 

Return true if we're using analytic fit algorithms.

Definition at line 225 of file Fitter.cpp.

References counterMutex, and internal_isUsingAnalyticAlgorithm().

Here is the call graph for this function:

char * SctFitter::Fitter::lastScan  )  throw ()
 

Get the name of the last scan which was fitted over ipc;.

Definition at line 362 of file Fitter.cpp.

long SctFitter::Fitter::nFitErrors  )  throw ()
 

returns the number of fit errors so far over ipc;

Definition at line 339 of file Fitter.cpp.

long SctFitter::Fitter::nFitsDone  )  throw ()
 

returns the number of fits done so far over ipc;

Definition at line 333 of file Fitter.cpp.

long SctFitter::Fitter::queueLength  ) 
 

number of jobs in the queue

Definition at line 345 of file Fitter.cpp.

References counterMutex, SctService::WorkerGroup< string >::queueSize(), and workergroup.

Here is the call graph for this function:

void SctFitter::Fitter::scanDone double  time  )  throw ()
 

Called by the workers to add to the total amount of scan time.

Definition at line 302 of file Fitter.cpp.

void SctFitter::Fitter::setFifo bool   ) 
 

set true for FIFO, false for FILO - see WorkerGroup for pros and cons!

Definition at line 373 of file Fitter.cpp.

References SctService::WorkerGroup< string >::setFifo(), and workergroup.

Here is the call graph for this function:

void SctFitter::Fitter::setFitOptions const char *  opt  )  throw () [virtual]
 

as for setFitOptions, but over IPC.

(asynchronous). Passes string on to FitStrategy;

Parameters:
the status of the IPC request.
the string to set as the options e.g. "NQR" for ROOT.

Definition at line 200 of file Fitter.cpp.

void SctFitter::Fitter::setFitStrategy const char *  strategy  )  throw () [virtual]
 

set the fit option over IPC.

(asynchronous).

Parameters:
the status of the IPC request : failure if name not found in map.
tries to find the stragegy with this name

Definition at line 244 of file Fitter.cpp.

void SctFitter::Fitter::setLastScanName const std::string &  name  )  [inline, private]
 

update record of last scan attempted.

Definition at line 251 of file Fitter.h.

void SctFitter::Fitter::shutdown  )  [private]
 

The following method is a new requirement of IPCNamedObjects under the omni-orb.

Definition at line 42 of file Fitter.cpp.

References getFitterServer(), SctService::WorkerGroup< string >::stop(), and workergroup.

Here is the call graph for this function:

char * SctFitter::Fitter::status  )  throw () [virtual]
 

As for getStatus, but available over IPC.

Makes a new char[] which ipc then deletes.

Parameters:
the status of the IPC request.

Definition at line 185 of file Fitter.cpp.

void SctFitter::Fitter::useAnalyticAlgorithm CORBA::Boolean  use  ) 
 

Determine whether to use the analytic fit algorithm.

Default is false

Definition at line 211 of file Fitter.cpp.


Friends And Related Function Documentation

friend class FitterWorkerGroup [friend]
 

FitterWorker is allowed to update stuff.

Definition at line 258 of file Fitter.h.


Field Documentation

boost::recursive_mutex SctFitter::Fitter::counterMutex [mutable, private]
 

Used to lock access to all the counters.

Definition at line 229 of file Fitter.h.

Referenced by busy(), internal_isUsingAnalyticAlgorithm(), isUsingAnalyticAlgorithm(), and queueLength().

FitStrategy* SctFitter::Fitter::m_fitStrategy [private]
 

Pointer to the fit strategy.

Definition at line 242 of file Fitter.h.

std::auto_ptr<ISInfoReceiver> SctFitter::Fitter::m_infoReceiver [private]
 

An InfoReveiver for RawRODData objects.

Definition at line 248 of file Fitter.h.

string SctFitter::Fitter::m_status [mutable, private]
 

pointer to char containing the status: cached so that we don't have to make lots of char*'s.

Definition at line 238 of file Fitter.h.

FitterWorkerGroup* SctFitter::Fitter::workergroup [private]
 

Group of workers which do the actual fitting.

Definition at line 244 of file Fitter.h.

Referenced by busy(), doFits(), isFifo(), queueLength(), setFifo(), and shutdown().


The documentation for this class was generated from the following files:
Generated on Fri Sep 16 18:04:39 2005 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5