#include <MetreCarreChamber.hh>
Inheritance diagram for MetreCarreChamber:
Public Member Functions | |
MetreCarreChamber (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) | |
~MetreCarreChamber () | |
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) |
Definition at line 18 of file MetreCarreChamber.hh.
MetreCarreChamber::MetreCarreChamber | ( | 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 MetreCarreChamber.cpp.
00023 : Chamber(aX, aY , aZ , xRotation, yRotation, zRotation, 2, 3 , id) 00024 { 00025 FILE_LOG(logDEBUG1) << "---MetreCarreChamber constructor id " << id << endl; 00026 00027 if ( difInfos.size() != 3 | 00028 boardInfos.size() != 5 | 00029 chipInfos.size() != 120) 00030 { 00031 FILE_LOG(logERROR)<< endl << "XML geometry error for chamber id[" << id << "] :MetreCarreChamber must be composed of:\n" 00032 "-[3] dif." << endl << 00033 "-[5] board." << endl << 00034 "-[120] chips." << endl << endl << 00035 "-> And in your XML file:" << endl << 00036 "[" << difInfos.size() << "] dif" << endl << 00037 "[" << boardInfos.size() << "] board" << endl << 00038 "[" << chipInfos.size() << "] chips" << endl; 00039 myIsValid = false; 00040 } 00041 00042 else { 00043 description = "MetreCarreChamber"; 00044 type = METRECARRECHAMBER; 00045 init(id, difInfos, boardInfos, chipInfos); 00046 myIsValid = true; 00047 } 00048 }
MetreCarreChamber::~MetreCarreChamber | ( | ) |
Definition at line 52 of file MetreCarreChamber.cpp.
00053 { 00054 //FILE_LOG(logDEBUG) << "---MetreCarreChamber destructor"<< endl; 00055 }; // ~MetreCarreChamber
void MetreCarreChamber::print | ( | void | ) | const |
unsigned int MetreCarreChamber::getNumberOfBoards | ( | ) | const [inline] |
const float MetreCarreChamber::getXGap | ( | ) | const [inline, virtual] |
const float MetreCarreChamber::getYGap | ( | ) | const [inline, virtual] |
void MetreCarreChamber::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 59 of file MetreCarreChamber.cpp.
Referenced by MetreCarreChamber().
00062 { 00063 int bcol = 0; 00064 int brow = 0; 00065 00066 00067 for (int difNum = 0 ; difNum < difInfos.size(); difNum++) 00068 { 00069 const DifInfo_t& difInfo = difInfos.at(difNum); 00070 if (difInfo.chamberId != this->getId()) 00071 { 00072 continue; 00073 } 00074 Dif *dif = new Dif(difInfo.id); 00075 00076 for (int boardNum = 0 ; boardNum < boardInfos.size(); boardNum++) 00077 { 00078 const BoardInfo_t& boardInfo = boardInfos.at(boardNum); 00079 if (boardInfo.difId != dif->getId() || boardInfo.chamberId != this->getId()) 00080 { 00081 continue; 00082 } 00083 00084 bcol= (boardNum ) % 2; 00085 Hardroc2Board *board = new Hardroc2Board(*this,bcol , brow , 6, 4, boardInfo.id); 00086 00087 this->addDif(dif); 00088 dif->addBoard(board); 00089 this->addBoard(board); 00090 00091 00092 00093 int ccol = 0; 00094 int crow = 0; 00095 for (int chipNum = 0; chipNum < chipInfos.size(); chipNum++) 00096 { 00097 const ChipInfo_t& chipInfo = chipInfos.at(chipNum); 00098 if ((chipInfo.boardId != boardInfo.id) 00099 || (chipInfo.difId != difInfo.id) 00100 || (chipInfo.chamberId != id)) 00101 { 00102 continue; 00103 } 00104 FILE_LOG(logDEBUG1)<< " Detector.build : chip " << chipInfo.id << ", board " << chipInfo.boardId << endl; 00105 ccol= chipNum%6 ; 00106 00107 00108 Hardroc2Chip *chip = new Hardroc2Chip(*board, ccol, crow, chipInfo.id,chipInfo.serial); 00109 board->addChip(chip); 00110 00111 if (ccol == 5) { ++crow; } 00112 } 00113 FILE_LOG(logDEBUG1)<< " Detector.build : dif " << difInfo.id << ", chamber " << difInfo.chamberId << *this << endl; 00114 //if ( brow >= 1) { bcol++ ; } 00115 if ( bcol >= 1) { brow++ ; } 00116 } 00117 } 00118 }