Chamber Class Reference

#include <Chamber.hh>

Inheritance diagram for Chamber:

Inheritance graph
[legend]
Collaboration diagram for Chamber:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const float getXLength () const
const float getYLength () const
virtual const float getXGap () const =0
virtual const float getYGap () const =0
 operator bool () const
bool operator! () const
bool isValid () const
unsigned int getNumberOfBoards () const
virtual unsigned int getNumberOfGassiplexBoards () const
BoardMap_t getBoards (void) const
void setDescription (const std::string aDesc)
std::string getDescription () const
std::string getType () const
const ChannelgetChannelById (const i32 channelId, const i32 chipId=-1, const i32 difId=-1) const
const BoardMap_t & getBoardsByDifId (const i32 difId) const
void addDif (Dif *dif)
DifgetDif (i32 key) const
DifMap_t getDifs () const
const DifgetDifById (const i32 difId) const
void addBoard (Board *board)
float getX () const
void setX (const float aX)
float getY () const
void setY (const float aY)
float getZ (void) const
void setZ (const float aZ)
const float getLeftBottomX () const
const float getLeftBottomY () const
const float getRightUpperX () const
const float getRightUpperY () const
i32 getId (void) const
void setId (const i32 aId)
bool getXrotation () const
void setXrotation (bool val)
bool getYrotation () const
void setYrotation (bool val)
i16 getZrotation () const
void setZrotation (i16 val)
ui32 getNbColumns (void) const
ui32 getNbRows (void) const

Protected Member Functions

 Chamber (const float xPos, const float yPos, const float zPos, bool xRotation, const bool yRotation, const i16 zRotation, const ui32 nbColumns, const ui32 nbRows, const i32 id)
 Chamber (const Chamber &source)
Chamberoperator= (const Chamber &source)
std::ostream & operator<< (std::ostream &out) const
virtual ~Chamber ()

Protected Attributes

float xPos
float yPos
float zPos
bool xRotation
bool yRotation
i16 zRotation
i32 id
std::string description
BoardMap_t boards
std::string type
ui32 nbColumns
ui32 nbRows
DifMap_t difs
bool myIsValid

Friends

class Detector
std::ostream & operator<< (std::ostream &out, const Chamber &x)

Detailed Description

CLASS CHAMBER //

Definition at line 37 of file Chamber.hh.


Constructor & Destructor Documentation

Chamber::Chamber ( const float  xPos,
const float  yPos,
const float  zPos,
bool  xRotation,
const bool  yRotation,
const i16  zRotation,
const ui32  nbColumns,
const ui32  nbRows,
const i32  id 
) [protected]

Definition at line 41 of file Chamber.cpp.

00042 : id(aId), xPos(aX), yPos(aY), zPos(aZ), xRotation(axRotation), yRotation(ayRotation), zRotation(azRotation) , description(""), nbColumns(aNbColumns) , nbRows(aNbRows)
00043 {
00044                 //cout << "Chamber[" << this->id << "] x[" << xPos <<"] y[" << yPos << "]" << endl;
00045 //  FILE_LOG(logDEBUG) << "--Chamber constructor id:" << id << endl;
00046 }

Chamber::Chamber ( const Chamber source  )  [protected]

Definition at line 50 of file Chamber.cpp.

00051 {
00052 //  FILE_LOG(logDEBUG) << "--Chamber Constructeur de copie"<< endl;
00053   *this = source;  //appel de l operateur =
00054 }

Chamber::~Chamber (  )  [protected, virtual]

Definition at line 75 of file Chamber.cpp.

00076 {
00077 //  FILE_LOG(logDEBUG)<< "----Chamber destructeur"<< endl;
00078   for (std::map<i32, Board *>::const_iterator it = boards.begin(); it != boards.end(); ++it) {
00079     delete (it->second);
00080   }
00081 }


Member Function Documentation

Chamber & Chamber::operator= ( const Chamber source  )  [protected]

Definition at line 58 of file Chamber.cpp.

00059 {
00060   //FILE_LOG(logDEBUG) << "--Chamber operator de copie"<< endl;
00061   xPos = source.xPos;
00062   yPos = source.yPos;
00063   zPos = source.zPos;
00064         xRotation = source.xRotation;
00065         yRotation = source.yRotation;
00066         zRotation = source.zRotation;
00067   id = source.id;
00068   description = source.description;
00069   boards = source.boards;
00070 //  type = source.type;
00071   return *this;
00072 }

std::ostream & Chamber::operator<< ( std::ostream &  out  )  const [protected]

Definition at line 22 of file Chamber.cpp.

00022                                                       {
00023   out << description << " id " << id << " @[" << xPos << ", " << yPos << ", " << zPos << "] x rotation[" << xRotation << "][ y rotation["  << yRotation << "] [ z rotation["  << zRotation << "]" << boards.size() << " boards, " << difs.size() << " difs" << endl;
00024 
00025 
00026   if (difs.size()) {
00027     for (DifMap_t::const_iterator it = difs.begin(); it != difs.end(); ++it) {
00028       out << *(it->second) << endl;
00029     }
00030   }
00031   else {
00032     for (std::map<i32, Board *>::const_iterator it = boards.begin(); it != boards.end(); ++it) {
00033       out << *(it->second) << endl;
00034     }
00035   }
00036   return(out);
00037 } // operator <<

const float Chamber::getXLength (  )  const

Definition at line 163 of file Chamber.cpp.

Referenced by getLeftBottomX(), getLeftBottomY(), getRightUpperX(), getRightUpperY(), Board::getXRelative(), main(), and MTChamber::operator=().

00164 {
00165   const Board& board = *(boards.begin()->second);
00166         //cout << "Chamber getXleght: this->nbRows[" << this->nbRows << "]  board.getXLength()[" << board.getXLength() <<"[ this->getXGap()[" <<  this->getXGap() << endl;
00167   return (this->nbRows *  board.getXLength()) + ( (this->nbRows -1 ) * this->getXGap() );
00168 }

const float Chamber::getYLength (  )  const

Definition at line 171 of file Chamber.cpp.

Referenced by getLeftBottomX(), getLeftBottomY(), getRightUpperX(), getRightUpperY(), Board::getYRelative(), main(), and MTChamber::operator=().

00172 {
00173   const Board& board = *(boards.begin()->second);
00174   return  (this->nbColumns *  board.getYLength() )+ ((this->nbColumns-1 ) *  this->getYGap() );
00175 }

virtual const float Chamber::getXGap (  )  const [pure virtual]

Implemented in DiracChamber1, GassiplexChamber1, GassiplexChamber4, GassiplexStripChamber1, Hardroc1Chamber, Hardroc2Chamber1, Hardroc2Chamber2, Hardroc2Chamber6, Hardroc2IPNLChamber6, MetreCarreChamber, MicrorocChamber1, MicrorocChamber6, and MicrorocTestChamber.

Referenced by Board::getXRelative().

virtual const float Chamber::getYGap (  )  const [pure virtual]

Implemented in DiracChamber1, GassiplexChamber1, GassiplexChamber4, GassiplexStripChamber1, Hardroc1Chamber, Hardroc2Chamber1, Hardroc2Chamber2, Hardroc2Chamber6, Hardroc2IPNLChamber6, MetreCarreChamber, MicrorocChamber1, MicrorocChamber6, and MicrorocTestChamber.

Referenced by Board::getYRelative().

Chamber::operator bool (  )  const [inline]

Definition at line 56 of file Chamber.hh.

00056 { return myIsValid; }

bool Chamber::operator! (  )  const [inline]

Definition at line 57 of file Chamber.hh.

00057 {  return !myIsValid; }

bool Chamber::isValid ( void   )  const [inline]

Definition at line 58 of file Chamber.hh.

00058 {  return myIsValid; }

unsigned int Chamber::getNumberOfBoards (  )  const [inline]

Reimplemented in DiracChamber1, GassiplexChamber1, GassiplexChamber4, GassiplexStripChamber1, Hardroc1Chamber, Hardroc2Chamber1, Hardroc2Chamber2, Hardroc2Chamber6, Hardroc2IPNLChamber6, MetreCarreChamber, MicrorocChamber1, MicrorocChamber6, and MicrorocTestChamber.

Definition at line 60 of file Chamber.hh.

00060 { return(boards.size()); };

virtual unsigned int Chamber::getNumberOfGassiplexBoards (  )  const [inline, virtual]

Reimplemented in GassiplexChamber1, GassiplexChamber4, and GassiplexStripChamber1.

Definition at line 61 of file Chamber.hh.

00061 { return 0; }; // only reimplement in GassioplexBoard* class

BoardMap_t Chamber::getBoards ( void   )  const [inline]

Definition at line 62 of file Chamber.hh.

Referenced by BeamProfile::FillHitPerChannel(), BeamProfile::FillHitPerChipDist(), main(), and MTChamber::operator=().

00062 { return boards; };

void Chamber::setDescription ( const std::string  aDesc  )  [inline]

Definition at line 64 of file Chamber.hh.

00064 { description = aDesc; };

std::string Chamber::getDescription (  )  const [inline]

Definition at line 65 of file Chamber.hh.

00065 { return description; };

std::string Chamber::getType (  )  const [inline]

Definition at line 66 of file Chamber.hh.

Referenced by EventDisplay::IsMicromegas(), main(), and MTChamber::operator=().

00066 { return type; };

const Channel & Chamber::getChannelById ( const i32  channelId,
const i32  chipId = -1,
const i32  difId = -1 
) const

Definition at line 104 of file Chamber.cpp.

00105 {
00106   // default case for Gassiplex without chipId and difId : direct use of the board list
00107   // case for Hardroc and Dirac boards which are connected to a Dif : look for the boards which Dif Id
00108   const BoardMap_t& boardMap = (chipId < 0) ? boards : getBoardsByDifId(difId);
00109 
00110   // then look for the channel with given board list
00111   //for (BoardMap_t::const_iterator boardIt = boards.begin(); boardIt != boards.end(); ++boardIt) {
00112   for (BoardMap_t::const_iterator boardIt = boardMap.begin(); boardIt != boardMap.end(); ++boardIt) {
00113     try {
00114       Channel& channel = boardIt->second->getChannelById(channelId, chipId);
00115       return(channel);
00116     }
00117     catch (MicroException &e) {
00118       //FILE_LOG(logDEBUG)<< "Chamber::getChannelById channelid["<< channelId << "] chipId:["<< chipId << "] difId:["<< difId << "], trying next board" << endl;
00119     }
00120   }
00121 
00122   throw MicroException("Chamber.getChannelById : no Channel found for this id and this chamber ");
00123 } // Chamber.getChannelById

const BoardMap_t & Chamber::getBoardsByDifId ( const i32  difId  )  const

Definition at line 95 of file Chamber.cpp.

Referenced by getChannelById().

00095                                                                  {
00096   DifMap_t::const_iterator difIt = difs.find(difId);
00097   if (difIt == difs.end()) {
00098     throw MicroException("no Dif found with this id: ");
00099   }
00100   return(difIt->second->getBoards());
00101 } // Chamber.getBoardByDifId

void Chamber::addDif ( Dif dif  ) 

Definition at line 84 of file Chamber.cpp.

Referenced by MicrorocTestChamber::init(), MicrorocChamber6::init(), MicrorocChamber1::init(), MetreCarreChamber::init(), Hardroc2IPNLChamber6::init(), Hardroc2Chamber6::init(), Hardroc2Chamber2::init(), Hardroc2Chamber1::init(), Hardroc1Chamber::init(), and DiracChamber1::init().

00085 {
00086   difs.insert(make_pair(dif->getId(), dif));
00087 } //

Dif* Chamber::getDif ( i32  key  )  const [inline]

Definition at line 71 of file Chamber.hh.

00071 { return difs.find(key)->second; } ;

DifMap_t Chamber::getDifs (  )  const [inline]

Definition at line 72 of file Chamber.hh.

Referenced by TestMicrorocParser::getNextEvent().

00072 { return difs ;} ;

const Dif & Chamber::getDifById ( const i32  difId  )  const

Definition at line 179 of file Chamber.cpp.

Referenced by BeamProfile::DrawChip2D().

00180 {
00181   std::map<i32, Dif *>::const_iterator it = difs.find(difId);
00182   if (it == difs.end())
00183     throw MicroException("Chanber.getDifById : no Dif found for this id");
00184 
00185   return(*(it->second));
00186 }; 

void Chamber::addBoard ( Board board  ) 

Definition at line 89 of file Chamber.cpp.

Referenced by MicrorocTestChamber::init(), MicrorocChamber6::init(), MicrorocChamber1::init(), MetreCarreChamber::init(), Hardroc2IPNLChamber6::init(), Hardroc2Chamber6::init(), Hardroc2Chamber2::init(), Hardroc2Chamber1::init(), Hardroc1Chamber::init(), and DiracChamber1::init().

00090 {
00091   boards.insert(make_pair(board->getId(), board));
00092 }

float Chamber::getX (  )  const

Definition at line 126 of file Chamber.cpp.

Referenced by getLeftBottomX(), getRightUpperX(), Chip::getX(), Channel::getX(), Board::getX(), main(), and MTChamber::operator=().

00127 {
00128   return xPos;
00129 }

void Chamber::setX ( const float  aX  )  [inline]

Definition at line 77 of file Chamber.hh.

00077 { xPos = aX; };

float Chamber::getY (  )  const

Definition at line 131 of file Chamber.cpp.

Referenced by getLeftBottomY(), getRightUpperY(), Chip::getY(), Channel::getY(), Board::getY(), main(), and MTChamber::operator=().

00132 {
00133 
00134   return yPos;
00135 }

void Chamber::setY ( const float  aY  )  [inline]

Definition at line 81 of file Chamber.hh.

00081 { yPos = aY; };

float Chamber::getZ ( void   )  const [inline]

Definition at line 83 of file Chamber.hh.

Referenced by Channel::getZ(), main(), Board::operator<<(), and MTChamber::operator=().

00083 { return zPos; };

void Chamber::setZ ( const float  aZ  )  [inline]

Definition at line 85 of file Chamber.hh.

00085 { zPos = aZ; };

const float Chamber::getLeftBottomX (  )  const

Definition at line 138 of file Chamber.cpp.

Referenced by BeamProfile::FillXyDist(), and main().

00139 {  
00140   if ( getZrotation() == 90 || getZrotation() == -90 ) return ( getX() - getYLength() / 2.);
00141    return ( getX() - getXLength() / 2.);
00142 }

const float Chamber::getLeftBottomY (  )  const

Definition at line 144 of file Chamber.cpp.

Referenced by BeamProfile::FillXyDist(), and main().

00145 {
00146   if ( getZrotation() == 90  || getZrotation() == -90) return ( getY() - getXLength() / 2.);
00147    return ( getY() - getYLength() / 2.); 
00148 }

const float Chamber::getRightUpperX (  )  const

Definition at line 150 of file Chamber.cpp.

Referenced by BeamProfile::FillXyDist(), and main().

00151 {
00152   if ( getZrotation() == 90  || getZrotation() == -90) return ( getX() + getYLength() / 2.);
00153    return ( getX() + getXLength() / 2.);
00154 }

const float Chamber::getRightUpperY (  )  const

Definition at line 156 of file Chamber.cpp.

Referenced by BeamProfile::FillXyDist(), and main().

00157 { 
00158   if ( getZrotation() == 90  || getZrotation() == -90) return ( getY() + getXLength() / 2.);
00159    return ( getY() + getYLength() / 2.);
00160 } 

i32 Chamber::getId ( void   )  const [inline]

Definition at line 92 of file Chamber.hh.

Referenced by Detector::addChamber(), Channel::Channel(), Chip::Chip(), Event::getChannelHitByOrder(), Event::getChannelHitVector(), MicrorocTestChamber::init(), MicrorocChamber6::init(), MicrorocChamber1::init(), MetreCarreChamber::init(), Hardroc2IPNLChamber6::init(), Hardroc2Chamber6::init(), Hardroc2Chamber2::init(), Hardroc1Chamber::init(), DiracChamber1::init(), Event::insertHit(), MTChannel::MTChannel(), MTChip::operator=(), MTChamber::operator=(), and Chip::operator=().

00092 { return id; };

void Chamber::setId ( const i32  aId  )  [inline]

Definition at line 93 of file Chamber.hh.

00093 { id = aId; };

bool Chamber::getXrotation (  )  const [inline]

Definition at line 95 of file Chamber.hh.

Referenced by Channel::getColInChamber(), Chip::getY(), main(), and MTChamber::operator=().

00095 { return xRotation ;};

void Chamber::setXrotation ( bool  val  )  [inline]

Definition at line 96 of file Chamber.hh.

00096 {  xRotation = val;};

bool Chamber::getYrotation (  )  const [inline]

Definition at line 98 of file Chamber.hh.

Referenced by Channel::getRowInChamber(), Chip::getX(), main(), and MTChamber::operator=().

00098 { return yRotation  ; };

void Chamber::setYrotation ( bool  val  )  [inline]

Definition at line 99 of file Chamber.hh.

00099 {  yRotation = val;};

i16 Chamber::getZrotation (  )  const [inline]

Definition at line 101 of file Chamber.hh.

Referenced by Channel::getColInChamber(), Chip::getLeftBottomX(), Channel::getLeftBottomX(), getLeftBottomX(), Chip::getLeftBottomY(), Channel::getLeftBottomY(), getLeftBottomY(), Chip::getRightUpperX(), Channel::getRightUpperX(), getRightUpperX(), Chip::getRightUpperY(), Channel::getRightUpperY(), getRightUpperY(), Channel::getRowInChamber(), Chip::getX(), Chip::getY(), main(), and MTChamber::operator=().

00101 { return zRotation  ; };

void Chamber::setZrotation ( i16  val  )  [inline]

Definition at line 102 of file Chamber.hh.

00102 {  zRotation = val;};

ui32 Chamber::getNbColumns ( void   )  const [inline]

Definition at line 108 of file Chamber.hh.

Referenced by Channel::getColInChamber(), and Channel::getRowInChamber().

00108 { return nbColumns; };

ui32 Chamber::getNbRows ( void   )  const [inline]

Definition at line 109 of file Chamber.hh.

Referenced by Channel::getColInChamber(), and Channel::getRowInChamber().

00109 { return nbRows; };


Friends And Related Function Documentation

friend class Detector [friend]

Definition at line 39 of file Chamber.hh.

std::ostream& operator<< ( std::ostream &  out,
const Chamber x 
) [friend]

Definition at line 17 of file Chamber.cpp.

00017                                                            {
00018   return(x.operator <<(out));
00019 } // operator <<


Member Data Documentation

float Chamber::xPos [protected]

Definition at line 109 of file Chamber.hh.

Referenced by getX(), operator<<(), operator=(), and setX().

float Chamber::yPos [protected]

Definition at line 109 of file Chamber.hh.

Referenced by getY(), operator<<(), operator=(), and setY().

float Chamber::zPos [protected]

Definition at line 109 of file Chamber.hh.

Referenced by GassiplexChamber1::GassiplexChamber1(), getZ(), operator<<(), operator=(), and setZ().

bool Chamber::xRotation [protected]

the chamber position

Definition at line 118 of file Chamber.hh.

Referenced by getXrotation(), operator<<(), operator=(), and setXrotation().

bool Chamber::yRotation [protected]

Definition at line 119 of file Chamber.hh.

Referenced by getYrotation(), operator<<(), operator=(), and setYrotation().

i16 Chamber::zRotation [protected]

Definition at line 120 of file Chamber.hh.

Referenced by getZrotation(), operator<<(), operator=(), and setZrotation().

i32 Chamber::id [protected]

Definition at line 121 of file Chamber.hh.

Referenced by getId(), and operator=().

std::string Chamber::description [protected]

the chamber unique id

Definition at line 122 of file Chamber.hh.

Referenced by DiracChamber1::DiracChamber1(), GassiplexChamber1::GassiplexChamber1(), GassiplexChamber4::GassiplexChamber4(), GassiplexStripChamber1::GassiplexStripChamber1(), getDescription(), Hardroc1Chamber::Hardroc1Chamber(), Hardroc2Chamber1::Hardroc2Chamber1(), Hardroc2Chamber2::Hardroc2Chamber2(), Hardroc2Chamber6::Hardroc2Chamber6(), Hardroc2IPNLChamber6::Hardroc2IPNLChamber6(), MetreCarreChamber::MetreCarreChamber(), MicrorocChamber1::MicrorocChamber1(), MicrorocChamber6::MicrorocChamber6(), MicrorocTestChamber::MicrorocTestChamber(), operator<<(), operator=(), and setDescription().

BoardMap_t Chamber::boards [protected]

short description

Definition at line 123 of file Chamber.hh.

Referenced by addBoard(), getBoards(), getChannelById(), getNumberOfBoards(), getXLength(), getYLength(), GassiplexStripChamber1::init(), GassiplexChamber4::init(), GassiplexChamber1::init(), operator<<(), operator=(), and ~Chamber().

std::string Chamber::type [protected]

the list of boards which compose the chamber

Definition at line 124 of file Chamber.hh.

Referenced by GassiplexChamber1::GassiplexChamber1(), GassiplexChamber4::GassiplexChamber4(), GassiplexStripChamber1::GassiplexStripChamber1(), getType(), Hardroc1Chamber::Hardroc1Chamber(), Hardroc2Chamber1::Hardroc2Chamber1(), Hardroc2Chamber2::Hardroc2Chamber2(), Hardroc2Chamber6::Hardroc2Chamber6(), Hardroc2IPNLChamber6::Hardroc2IPNLChamber6(), MetreCarreChamber::MetreCarreChamber(), MicrorocChamber1::MicrorocChamber1(), MicrorocChamber6::MicrorocChamber6(), and MicrorocTestChamber::MicrorocTestChamber().

ui32 Chamber::nbColumns [protected]

the type of the chamber

Definition at line 125 of file Chamber.hh.

Referenced by getNbColumns().

ui32 Chamber::nbRows [protected]

Definition at line 125 of file Chamber.hh.

DifMap_t Chamber::difs [protected]

number of board row and column

Definition at line 126 of file Chamber.hh.

Referenced by addDif(), getBoardsByDifId(), getDif(), getDifById(), getDifs(), and operator<<().

bool Chamber::myIsValid [protected]

the list of difs which compose the chamber (Hardroc and Dirac only)

Definition at line 127 of file Chamber.hh.

Referenced by DiracChamber1::DiracChamber1(), GassiplexChamber1::GassiplexChamber1(), GassiplexChamber4::GassiplexChamber4(), GassiplexStripChamber1::GassiplexStripChamber1(), Hardroc1Chamber::Hardroc1Chamber(), Hardroc2Chamber1::Hardroc2Chamber1(), Hardroc2Chamber2::Hardroc2Chamber2(), Hardroc2Chamber6::Hardroc2Chamber6(), Hardroc2IPNLChamber6::Hardroc2IPNLChamber6(), isValid(), MetreCarreChamber::MetreCarreChamber(), MicrorocChamber1::MicrorocChamber1(), MicrorocChamber6::MicrorocChamber6(), MicrorocTestChamber::MicrorocTestChamber(), operator bool(), and operator!().


The documentation for this class was generated from the following files:
Generated on Mon Jan 7 13:18:04 2013 for MicromegasFramework by  doxygen 1.4.7