pit_configuration Class Reference

#include <pit_configuration.h>

List of all members.

Public Member Functions

void openCoordinateTableFile (const char *filename)
void openRequiredChannelsFile (const char *filename)
 Gets a the list of all required fastor channels from a file.
t_sideCoord getSide (unsigned int optinNumber, unsigned int linkNumber) const
unsigned int getSector (unsigned int optinNumber, unsigned int linkNumber) const
unsigned int getHalfStave (unsigned int optinNumber, unsigned int linkNumber) const
unsigned int getBoardNumber (t_sideCoord side, unsigned int sector, unsigned int half_stave) const
unsigned int getBoardNumber (char side, unsigned int sector, unsigned int half_stave) const
 overloaded functio to be able to use a character side
unsigned int getLinkNumber (t_sideCoord side, unsigned int sector, unsigned int half_stave) const
unsigned int getLinkNumber (char side, unsigned int sector, unsigned int half_stave) const
 overloaded functio so to be able to use the character 'A' or 'C'
bool isLinkRequired (unsigned int optinNumber, unsigned int linkNumber) const
 returns if a link is required by optinNumber, linkNumber
bool isLinkRequired (t_sideCoord side, unsigned int sector, unsigned int half_stave) const
 returns if a link is required by side, sector, half_stave
bool getFastorRequired (unsigned int board, unsigned int link, unsigned int foChannel) const
 gets the fastor required
std::string getFastorRequired (unsigned int board, unsigned int link) const
 gets the fastors required for one optical link in a string of the type "11111000000"
bool getLinkRequired (unsigned int board, unsigned int link) const
void printRequiredChannelList () const
 prints the required channel list to screen for debugging purposes
void printPitCoordinateTable () const
 prints the cordinates pit coordinates to screen so side,sector,halfstave = board, link
void printSpdCoordinateTable () const
 prints the cordinates spd coordinates to screen so board, link= side,sector,halfstave
void dumpCoordinateTableToFile (const char *filename) const
void dumpRequiredLinksToFile (const char *filename) const

Static Public Member Functions

static pit_configurationgetInstance ()
 getInstance method to be used in order to obtain the single instance of this class

Private Member Functions

 pit_configuration ()
 private constructor to oblige the user to use the getInstance method
void setDefaultCoordinates (void)
 function to se the default Coodinates into the internal arrays
void setDefaultRequiredChannels (void)
 function to set the default values into the required channels internal array
void setRequired (unsigned int board, unsigned int link, unsigned int foChannel, bool value)
 private function to set one fastor channel required value doing the bound checking
void setRequired (unsigned int board, unsigned int link, const std::string &foChannelsValues)
 private function to set one all fastor channels required values of one optical link using a binary string ex: "1110000011"
void setCoordinate (unsigned int optinBoard, unsigned int linkChannel, unsigned int sector, t_sideCoord side, unsigned int halfStave)
 private function to insert one coordinate in both tables doing the bound checking
bool parseCoordinateLine (const std::string &line)
 function to parse the coordinates correspondace of a single optical link from a string
bool parseRequiredChannelLine (const std::string &line)
 function to parse the FO channels required of a optical link from a string

Private Attributes

t_pit_coordinate pit_coordinate [NUMBER_SIDES][NUMBER_SECTORS][NUMBER_HALF_STAVES_SECTOR]
 data member table to store pit coordinate from SPD coordinates
t_spd_coordinate spd_coordinate [NUMBER_OPTIN][NUMBER_OPTICAL_LINKS]
 data member table to store spd coordinate from pit coordinates
bool requiredChannels [NUMBER_OPTIN][NUMBER_OPTICAL_LINKS][NUMBER_FO_CHANNELS]
log4cpp::Category * logPitConfiguration


Detailed Description

Definition at line 25 of file pit_configuration.h.


Constructor & Destructor Documentation

pit_configuration::pit_configuration (  )  [private]

private constructor to oblige the user to use the getInstance method

Definition at line 10 of file pit_configuration.cpp.

References logPitConfiguration, setDefaultCoordinates(), and setDefaultRequiredChannels().


Member Function Documentation

void pit_configuration::setDefaultCoordinates ( void   )  [private]

function to se the default Coodinates into the internal arrays

filling the data member values with defaults values, assuming optin boards from 0 to 5 are connected to side A, mcms on half sectors (0,1) are connected on board 0, those on sectors (2,3) on board 1, those on sectors (4,5) on board 2 and so on

Definition at line 291 of file pit_configuration.cpp.

References A, C, NUMBER_OPTICAL_LINKS, NUMBER_OPTIN, and setCoordinate().

Referenced by openCoordinateTableFile(), and pit_configuration().

void pit_configuration::setDefaultRequiredChannels ( void   )  [private]

function to set the default values into the required channels internal array

sets all as required for the moment

Definition at line 34 of file pit_configuration.cpp.

References NUMBER_FO_CHANNELS, NUMBER_OPTICAL_LINKS, NUMBER_OPTIN, and requiredChannels.

Referenced by openRequiredChannelsFile(), and pit_configuration().

void pit_configuration::setRequired ( unsigned int  board,
unsigned int  link,
unsigned int  foChannel,
bool  value 
) [private]

private function to set one fastor channel required value doing the bound checking

Definition at line 145 of file pit_configuration.cpp.

References NUMBER_FO_CHANNELS, NUMBER_OPTICAL_LINKS, NUMBER_OPTIN, and requiredChannels.

void pit_configuration::setRequired ( unsigned int  board,
unsigned int  link,
const std::string &  foChannelsValues 
) [private]

private function to set one all fastor channels required values of one optical link using a binary string ex: "1110000011"

throws an exception if there are any other type of characters different than '0' and '1'

void pit_configuration::setCoordinate ( unsigned int  optinBoard,
unsigned int  linkChannel,
unsigned int  sector,
t_sideCoord  side,
unsigned int  halfStave 
) [private]

private function to insert one coordinate in both tables doing the bound checking

Definition at line 347 of file pit_configuration.cpp.

References t_spd_coordinate::half_stave, t_pit_coordinate::linkNumber, logPitConfiguration, NUMBER_HALF_STAVES_SECTOR, NUMBER_OPTICAL_LINKS, NUMBER_OPTIN, NUMBER_SECTORS, NUMBER_SIDES, t_pit_coordinate::optinNumber, pit_coordinate, t_spd_coordinate::sector, t_spd_coordinate::side, and spd_coordinate.

Referenced by setDefaultCoordinates().

bool pit_configuration::parseCoordinateLine ( const std::string &  line  )  [private]

function to parse the coordinates correspondace of a single optical link from a string

returns true is the line was correctly parsed and false if it was not expects a white separated argument list with : board link sector side halfstave

Referenced by openCoordinateTableFile().

bool pit_configuration::parseRequiredChannelLine ( const std::string &  line  )  [private]

function to parse the FO channels required of a optical link from a string

retuns true is the line was correctly parsed and false if it was not

Referenced by openRequiredChannelsFile().

pit_configuration & pit_configuration::getInstance (  )  [static]

getInstance method to be used in order to obtain the single instance of this class

Definition at line 26 of file pit_configuration.cpp.

Referenced by pit_driver::executeCommand(), pit_driver::getFoChannelFromStream(), pit_driver::getLinkFromStream(), pit_driver::getOptinBoardFromStream(), main(), pit_driver_opticalLink::refreshDetectorCoordinates(), and pit_driver_opticalLink::refreshLinkRequired().

void pit_configuration::openCoordinateTableFile ( const char *  filename  ) 

public methos to open and parse one configuration table file uses parseTableFileLine to larse each line throws ios::failure if it cannot open the file

Definition at line 241 of file pit_configuration.cpp.

References logPitConfiguration, NUMBER_OPTICAL_LINKS, parseCoordinateLine(), and setDefaultCoordinates().

Referenced by main().

void pit_configuration::openRequiredChannelsFile ( const char *  filename  ) 

Gets a the list of all required fastor channels from a file.

it expects a 120 integer values, one per optical link, where there can be extracted the 10 bits for each one of the fastors expects a white space separeted arguments list with the follwing order sector side halfstave requiredfastor(binary number) ex: 1 A 0 1111100000

Definition at line 158 of file pit_configuration.cpp.

References logPitConfiguration, NUMBER_HALF_STAVES, parseRequiredChannelLine(), and setDefaultRequiredChannels().

Referenced by pit_driver::executeCommand().

t_sideCoord pit_configuration::getSide ( unsigned int  optinNumber,
unsigned int  linkNumber 
) const [inline]

Returns detector coordinate side from the pit OPTIN board number

Parameters:
optinNumber and the link number
linkNumber 

Definition at line 89 of file pit_configuration.h.

References t_spd_coordinate::side, and spd_coordinate.

Referenced by dumpCoordinateTableToFile(), and pit_driver_opticalLink::refreshDetectorCoordinates().

unsigned int pit_configuration::getSector ( unsigned int  optinNumber,
unsigned int  linkNumber 
) const [inline]

Returns detector coordinate sector from the pit OPTIN board number

Parameters:
optinNumber and the link number
linkNumber 

Definition at line 94 of file pit_configuration.h.

References t_spd_coordinate::sector, and spd_coordinate.

Referenced by dumpCoordinateTableToFile(), and pit_driver_opticalLink::refreshDetectorCoordinates().

unsigned int pit_configuration::getHalfStave ( unsigned int  optinNumber,
unsigned int  linkNumber 
) const [inline]

Returns detector coordinate half_stave number from the pit OPTIN board number

Parameters:
optinNumber and the link number
linkNumber 

Definition at line 99 of file pit_configuration.h.

References t_spd_coordinate::half_stave, and spd_coordinate.

Referenced by dumpCoordinateTableToFile(), and pit_driver_opticalLink::refreshDetectorCoordinates().

unsigned int pit_configuration::getBoardNumber ( t_sideCoord  side,
unsigned int  sector,
unsigned int  half_stave 
) const

Returns pixeltrigger coordinate OPTIN board number from the SPD side coordinate

Parameters:
side the SPD sector number
sector and the half_stave number
half_stave 

Definition at line 407 of file pit_configuration.cpp.

References logPitConfiguration, NUMBER_HALF_STAVES_SECTOR, NUMBER_SECTORS, t_pit_coordinate::optinNumber, and pit_coordinate.

Referenced by dumpRequiredLinksToFile(), getBoardNumber(), pit_driver::getFoChannelFromStream(), pit_driver::getLinkFromStream(), and pit_driver::getOptinBoardFromStream().

unsigned int pit_configuration::getBoardNumber ( char  side,
unsigned int  sector,
unsigned int  half_stave 
) const

overloaded functio to be able to use a character side

Definition at line 373 of file pit_configuration.cpp.

References A, C, getBoardNumber(), and logPitConfiguration.

unsigned int pit_configuration::getLinkNumber ( t_sideCoord  side,
unsigned int  sector,
unsigned int  half_stave 
) const

Returns pixeltrigger coordinate linkNumber from the SPD side coordinate

Parameters:
side the SPD sector number
sector and the half_stave number
half_stave 

Definition at line 416 of file pit_configuration.cpp.

References t_pit_coordinate::linkNumber, logPitConfiguration, NUMBER_HALF_STAVES_SECTOR, NUMBER_SECTORS, and pit_coordinate.

Referenced by dumpRequiredLinksToFile(), pit_driver::getFoChannelFromStream(), pit_driver::getLinkFromStream(), getLinkNumber(), and pit_driver::getOptinBoardFromStream().

unsigned int pit_configuration::getLinkNumber ( char  side,
unsigned int  sector,
unsigned int  half_stave 
) const

overloaded functio so to be able to use the character 'A' or 'C'

Definition at line 390 of file pit_configuration.cpp.

References A, C, getLinkNumber(), and logPitConfiguration.

bool pit_configuration::isLinkRequired ( unsigned int  optinNumber,
unsigned int  linkNumber 
) const

returns if a link is required by optinNumber, linkNumber

bool pit_configuration::isLinkRequired ( t_sideCoord  side,
unsigned int  sector,
unsigned int  half_stave 
) const

returns if a link is required by side, sector, half_stave

bool pit_configuration::getFastorRequired ( unsigned int  board,
unsigned int  link,
unsigned int  foChannel 
) const

gets the fastor required

Definition at line 424 of file pit_configuration.cpp.

References logPitConfiguration, NUMBER_FO_CHANNELS, NUMBER_OPTICAL_LINKS, NUMBER_OPTIN, and requiredChannels.

Referenced by dumpRequiredLinksToFile(), getLinkRequired(), and printRequiredChannelList().

string pit_configuration::getFastorRequired ( unsigned int  board,
unsigned int  link 
) const

gets the fastors required for one optical link in a string of the type "11111000000"

Definition at line 433 of file pit_configuration.cpp.

References NUMBER_FO_CHANNELS, and requiredChannels.

bool pit_configuration::getLinkRequired ( unsigned int  board,
unsigned int  link 
) const

Definition at line 453 of file pit_configuration.cpp.

References getFastorRequired().

Referenced by pit_driver_opticalLink::refreshLinkRequired().

void pit_configuration::printRequiredChannelList (  )  const

prints the required channel list to screen for debugging purposes

Definition at line 444 of file pit_configuration.cpp.

References getFastorRequired(), NUMBER_OPTICAL_LINKS, and NUMBER_OPTIN.

void pit_configuration::printPitCoordinateTable (  )  const

prints the cordinates pit coordinates to screen so side,sector,halfstave = board, link

Definition at line 47 of file pit_configuration.cpp.

References A, C, t_pit_coordinate::linkNumber, NUMBER_HALF_STAVES_SECTOR, NUMBER_SECTORS, t_pit_coordinate::optinNumber, and pit_coordinate.

void pit_configuration::printSpdCoordinateTable (  )  const

prints the cordinates spd coordinates to screen so board, link= side,sector,halfstave

Definition at line 77 of file pit_configuration.cpp.

References A, C, t_spd_coordinate::half_stave, NUMBER_OPTICAL_LINKS, NUMBER_OPTIN, t_spd_coordinate::sector, and spd_coordinate.

void pit_configuration::dumpCoordinateTableToFile ( const char *  filename  )  const

Definition at line 460 of file pit_configuration.cpp.

References A, getHalfStave(), getSector(), getSide(), logPitConfiguration, NUMBER_OPTICAL_LINKS, and NUMBER_OPTIN.

void pit_configuration::dumpRequiredLinksToFile ( const char *  filename  )  const

Definition at line 489 of file pit_configuration.cpp.

References getBoardNumber(), getFastorRequired(), getLinkNumber(), logPitConfiguration, NUMBER_HALF_STAVES_SECTOR, NUMBER_SECTORS, and NUMBER_SIDES.


Member Data Documentation

t_pit_coordinate pit_configuration::pit_coordinate[NUMBER_SIDES][NUMBER_SECTORS][NUMBER_HALF_STAVES_SECTOR] [private]

data member table to store pit coordinate from SPD coordinates

Definition at line 30 of file pit_configuration.h.

Referenced by getBoardNumber(), getLinkNumber(), printPitCoordinateTable(), and setCoordinate().

t_spd_coordinate pit_configuration::spd_coordinate[NUMBER_OPTIN][NUMBER_OPTICAL_LINKS] [private]

data member table to store spd coordinate from pit coordinates

Definition at line 33 of file pit_configuration.h.

Referenced by getHalfStave(), getSector(), getSide(), printSpdCoordinateTable(), and setCoordinate().

bool pit_configuration::requiredChannels[NUMBER_OPTIN][NUMBER_OPTICAL_LINKS][NUMBER_FO_CHANNELS] [private]

Definition at line 35 of file pit_configuration.h.

Referenced by getFastorRequired(), setDefaultRequiredChannels(), and setRequired().

log4cpp::Category* pit_configuration::logPitConfiguration [private]

Definition at line 37 of file pit_configuration.h.

Referenced by dumpCoordinateTableToFile(), dumpRequiredLinksToFile(), getBoardNumber(), getFastorRequired(), getLinkNumber(), openCoordinateTableFile(), openRequiredChannelsFile(), pit_configuration(), and setCoordinate().


The documentation for this class was generated from the following files:
Generated on Sat Mar 29 22:55:55 2008 for pixelTrigger by  doxygen 1.5.0