MTChamber Class Reference

#include <MTChamber.hh>

Inheritance diagram for MTChamber:

Inheritance graph
[legend]
Collaboration diagram for MTChamber:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MTChamber ()
 MTChamber (const Chamber &aChamber)
virtual ~MTChamber ()
MTChamberoperator= (const Chamber &aChamber)
void Info (void) const
TString GetType () const
Int_t GetId () const
void SetId (UInt_t value)
const std::map< UInt_t, MTBoard * > & GetBoards (void) const
MTBoardGetBoard (UInt_t id) const
const float GetXLength () const
const float GetYLength () const
const float GetLeftBottomX () const
const float GetLeftBottomY () const
const float GetRightUpperX () const
const float GetRightUpperY () const

Private Attributes

Int_t id
TString type
std::map< UInt_t, MTBoard * > boards
float xPos
float yPos
float zPos
bool xRotation
bool yRotation
Int_t zRotation
float xLength
float yLength

Detailed Description

CLASS MTChamber(containing chamber configuration)

Definition at line 21 of file MTChamber.hh.


Constructor & Destructor Documentation

MTChamber::MTChamber (  ) 

MTChamber::MTChamber ( const Chamber aChamber  ) 

Definition at line 33 of file MTChamber.cpp.

00034  {
00035      (*this) = aChamber; // appelle operator=
00036  }

MTChamber::~MTChamber (  )  [virtual]

Definition at line 38 of file MTChamber.cpp.

00039 {
00040 //    for( map<UInt_t,MTDif*>::iterator iiDif=this->difs.begin(); iiDif!=this->difs.end(); ++iiDif)
00041 //    {
00042 //        delete (*iiDif).second;
00043 //    }
00044 
00045     for( map<UInt_t,MTBoard*>::const_iterator iiBoard=this->boards.begin(); iiBoard!=this->boards.end(); ++iiBoard)
00046     {
00047         delete (*iiBoard).second;
00048     }
00049 
00050 }


Member Function Documentation

MTChamber & MTChamber::operator= ( const Chamber aChamber  ) 

Definition at line 52 of file MTChamber.cpp.

00054 {
00055     try
00056     {
00057         id    = aChamber.getId();
00058         type  = aChamber.getType();
00059         xPos  = aChamber.getX();
00060         yPos  = aChamber.getY();
00061         zPos  = aChamber.getZ(); 
00062         xLength = aChamber.getXLength();
00063         yLength = aChamber.getYLength();
00064         xRotation = aChamber.getXrotation(); 
00065         yRotation = aChamber.getYrotation();
00066         zRotation = aChamber.getZrotation();
00067 
00068 /*
00069         const DifMap_t& chamberDifs = aChamber.getDifs();
00070         for (DifMap_t::const_iterator difIt = chamberDifs.begin(); difIt != chamberDifs.end(); ++difIt)
00071         {
00072             Dif& dif = *(difIt->second);
00073             MTDif *mtDif = new MTDif(dif);
00074             difs[dif.getId()] = mtDif;
00075 
00076                                         const BoardMap_t& chamberBoards = dif.getBoards();
00077                                         for (BoardMap_t::const_iterator boardIt = chamberBoards.begin(); boardIt != chamberBoards.end(); ++boardIt)
00078                                         {
00079                                                         Board& board = *(boardIt->second);
00080                                                         MTBoard *mtBoard = new MTBoard(board);
00081                                                         //mtBoard->SetDif(mtDif);
00082                                                         boards[board.getId()] = mtBoard;
00083                                         }
00084                                 }
00085 */
00086         const BoardMap_t& chamberBoards = aChamber.getBoards();
00087         for (BoardMap_t::const_iterator boardIt = chamberBoards.begin(); boardIt != chamberBoards.end(); ++boardIt)
00088         {
00089                                                         Board& board = *(boardIt->second);
00090                                                         MTBoard *mtBoard = new MTBoard(board);
00091                                                         boards[board.getId()] = mtBoard;
00092        }
00093     }
00094     catch (MicroException e)
00095     {
00096         throw MicroException(e.getMessage());
00097     }
00098     return *this;
00099 
00100 }

void MTChamber::Info ( void   )  const

Definition at line 103 of file MTChamber.cpp.

00104 {
00105 
00106   cout << "**** Chamber informations ****"    << endl << endl ;
00107   cout << "    Id: " << id << "    " << endl ;
00108   cout << "    Type:  "<< type << endl;
00109 }

TString MTChamber::GetType (  )  const [inline]

Definition at line 30 of file MTChamber.hh.

00030 { return type; } ;

Int_t MTChamber::GetId ( void   )  const [inline]

Definition at line 31 of file MTChamber.hh.

00031 { return id; } ;

void MTChamber::SetId ( UInt_t  value  )  [inline]

Definition at line 32 of file MTChamber.hh.

00032 { id = value; } ;

const std::map<UInt_t,MTBoard*>& MTChamber::GetBoards ( void   )  const [inline]

Definition at line 39 of file MTChamber.hh.

Referenced by MTRun::GetOneChip().

00039 { return boards; } ;

MTBoard& MTChamber::GetBoard ( UInt_t  id  )  const [inline]

Definition at line 40 of file MTChamber.hh.

00040 { return *(boards.find(id)->second); };

const float MTChamber::GetXLength (  )  const [inline]

Definition at line 42 of file MTChamber.hh.

Referenced by GetLeftBottomX(), and GetRightUpperX().

00042 { return xLength; }  ;

const float MTChamber::GetYLength (  )  const [inline]

Definition at line 43 of file MTChamber.hh.

Referenced by GetLeftBottomY(), and GetRightUpperY().

00043 { return yLength; }  ;

const float MTChamber::GetLeftBottomX (  )  const

Definition at line 113 of file MTChamber.cpp.

00114 {
00115   if ( zRotation == 90 || zRotation == -90 ) return ( xPos - yLength / 2.);
00116    return ( xPos - GetXLength() / 2.);
00117 
00118 }

const float MTChamber::GetLeftBottomY (  )  const

Definition at line 120 of file MTChamber.cpp.

00121 {
00122   if ( zRotation == 90  || zRotation == -90) return ( yPos - xLength / 2.);
00123    return ( yPos - GetYLength() / 2.);
00124 }

const float MTChamber::GetRightUpperX (  )  const

Definition at line 126 of file MTChamber.cpp.

00127 {
00128   if ( zRotation == 90  || zRotation == -90) return ( xPos + yLength / 2.);
00129    return ( xPos + GetXLength() / 2.);
00130 }

const float MTChamber::GetRightUpperY (  )  const

Definition at line 132 of file MTChamber.cpp.

00133 {
00134   if ( zRotation == 90  || zRotation == -90) return ( yPos + xLength / 2.);
00135    return ( yPos + GetYLength() / 2.);
00136 }


Member Data Documentation

Int_t MTChamber::id [private]

Definition at line 52 of file MTChamber.hh.

Referenced by GetId().

TString MTChamber::type [private]

Definition at line 53 of file MTChamber.hh.

Referenced by GetType(), Info(), and operator=().

std::map<UInt_t,MTBoard*> MTChamber::boards [private]

Definition at line 57 of file MTChamber.hh.

Referenced by GetBoard(), GetBoards(), operator=(), and ~MTChamber().

float MTChamber::xPos [private]

Definition at line 59 of file MTChamber.hh.

Referenced by GetLeftBottomX(), GetRightUpperX(), and operator=().

float MTChamber::yPos [private]

Definition at line 59 of file MTChamber.hh.

Referenced by GetLeftBottomY(), GetRightUpperY(), and operator=().

float MTChamber::zPos [private]

Definition at line 59 of file MTChamber.hh.

Referenced by operator=().

bool MTChamber::xRotation [private]

the chamber position

Definition at line 60 of file MTChamber.hh.

Referenced by operator=().

bool MTChamber::yRotation [private]

Definition at line 61 of file MTChamber.hh.

Referenced by operator=().

Int_t MTChamber::zRotation [private]

Definition at line 62 of file MTChamber.hh.

Referenced by GetLeftBottomX(), GetLeftBottomY(), GetRightUpperX(), GetRightUpperY(), and operator=().

float MTChamber::xLength [private]

Definition at line 64 of file MTChamber.hh.

Referenced by GetLeftBottomY(), GetRightUpperY(), GetXLength(), and operator=().

float MTChamber::yLength [private]

Definition at line 65 of file MTChamber.hh.

Referenced by GetLeftBottomX(), GetRightUpperX(), GetYLength(), and operator=().


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