DiracChamber1 Class Reference

#include <DiracChamber1.hh>

Inheritance diagram for DiracChamber1:

Inheritance graph
[legend]
Collaboration diagram for DiracChamber1:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DiracChamber1 (const float aX, const float aY, const float aZ, const bool xRotation, const bool yRotation, const i16 zRotation, const i32 id, const std::vector< DifInfo_t > &difInfos, const std::vector< BoardInfo_t > &boardInfos, const std::vector< ChipInfo_t > &chipInfos)
 ~DiracChamber1 ()
void print (void) const
unsigned int getNumberOfBoards () const
const float getXGap () const
const float getYGap () const

Protected Member Functions

void init (i32 chamberId, const std::vector< DifInfo_t > &difInfos, const std::vector< BoardInfo_t > &boardInfos, const std::vector< ChipInfo_t > &chipInfos)

Detailed Description

Definition at line 20 of file DiracChamber1.hh.


Constructor & Destructor Documentation

DiracChamber1::DiracChamber1 ( const float  aX,
const float  aY,
const float  aZ,
const bool  xRotation,
const bool  yRotation,
const i16  zRotation,
const i32  id,
const std::vector< DifInfo_t > &  difInfos,
const std::vector< BoardInfo_t > &  boardInfos,
const std::vector< ChipInfo_t > &  chipInfos 
)

Definition at line 19 of file DiracChamber1.cpp.

00023 : Chamber(aX, aY , aZ ,  xRotation,yRotation, zRotation, 1, 1 , id)
00024 {
00025 
00026   if ( difInfos.size() != 1 |
00027       boardInfos.size() != 1 |
00028       chipInfos.size()  != 1)
00029    {
00030        FILE_LOG(logERROR)<< endl << "XML geometry error for chamber id[" << id << "] :DiracChamber1 must be composed of:\n"
00031             "-[1] dif." << endl <<
00032             "-[1] board." << endl <<
00033             "-[1] chips." << endl << endl <<
00034             "-> And chamber your XML file is composed of:" << endl <<
00035             "[" <<  difInfos.size()   << "] dif" << endl <<
00036             "[" <<  boardInfos.size() << "] board" << endl <<
00037             "[" <<  chipInfos.size()  << "] chips" << endl;
00038        myIsValid = false;
00039   }
00040   else {
00041     FILE_LOG(logDEBUG1) << "---DiracChamber1 constructor id " << id << endl;
00042      description = "DiracChamber1";
00043     // type = DIRACCHAMBER;
00044      init(id, difInfos,  boardInfos,  chipInfos);
00045      myIsValid = true;
00046   }
00047 
00048 }; // DiracChamber1

DiracChamber1::~DiracChamber1 (  ) 

Definition at line 51 of file DiracChamber1.cpp.

00052 {
00053   //FILE_LOG(logDEBUG) << "---DiracChamber1 destructor"<< endl;
00054 }; // ~DiracChamber1


Member Function Documentation

void DiracChamber1::print ( void   )  const

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

Reimplemented from Chamber.

Definition at line 30 of file DiracChamber1.hh.

00030 { return 1; }

const float DiracChamber1::getXGap (  )  const [inline, virtual]

Implements Chamber.

Definition at line 32 of file DiracChamber1.hh.

00032 { return(0); };// in centimeter

const float DiracChamber1::getYGap (  )  const [inline, virtual]

Implements Chamber.

Definition at line 33 of file DiracChamber1.hh.

00033 { return(0); };// in centimeter

void DiracChamber1::init ( i32  chamberId,
const std::vector< DifInfo_t > &  difInfos,
const std::vector< BoardInfo_t > &  boardInfos,
const std::vector< ChipInfo_t > &  chipInfos 
) [protected]

Definition at line 58 of file DiracChamber1.cpp.

Referenced by DiracChamber1().

00061 {
00062 
00063 
00064       FILE_LOG(logDEBUG1)<< " add chamber[" << id << "]" <<  endl;
00065       for (int difNum = 0 ; difNum < difInfos.size(); difNum++)
00066       {
00067           const DifInfo_t& difInfo = difInfos[difNum];
00068 
00069           if (difInfo.chamberId != this->getId() )
00070           {
00071               continue;
00072           }
00073 
00074           Dif *dif = new Dif(difInfo.id);
00075           this->addDif(dif);
00076 
00077           for (int boardNum = 0 ; boardNum < boardInfos.size(); boardNum++) {
00078               const BoardInfo_t& boardInfo = boardInfos[boardNum];
00079               if (boardInfo.difId != dif->getId() || boardInfo.chamberId != this->getId())
00080               {
00081                   continue;
00082               }
00083               DiracBoard *board = new DiracBoard(*this, 0,  0, 1, 1, boardInfo.id);
00084               dif->addBoard(board);
00085               this->addBoard(board);
00086 
00087 
00088 
00089               for (int chipNum = 0, crow = 0 ; chipNum < chipInfos.size(); chipNum++) {
00090                   const ChipInfo_t& chipInfo = chipInfos[chipNum];
00091                   if ((chipInfo.boardId != boardInfo.id)
00092                    || (chipInfo.difId != difInfo.id)
00093                    || (chipInfo.chamberId != id))
00094                     continue;
00095                   FILE_LOG(logDEBUG1)<< "      Detector.build : chip " << chipInfo.id << ", board " << chipInfo.boardId << endl;
00096                   int crow = chipNum % 4;
00097                   DiracChip *chip = new DiracChip(*board, 0, crow, 8, 8, chipInfo.id,chipInfo.serial);
00098                   board->addChip(chip);
00099               }
00100               FILE_LOG(logDEBUG1)<< "  Detector.build : dif " << difInfo.id << ", chamber " << difInfo.chamberId << *this << endl;
00101           }
00102       }
00103 }


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