#include <Hardroc2Chamber2.hh>
Inheritance diagram for Hardroc2Chamber2:
Public Member Functions | |
Hardroc2Chamber2 (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) | |
~Hardroc2Chamber2 () | |
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 Hardroc2Chamber2.hh.
Hardroc2Chamber2::Hardroc2Chamber2 | ( | 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 Hardroc2Chamber2.cpp.
00023 : Chamber(aX, aY , aZ , xRotation,yRotation,zRotation, 2 ,1 , id) 00024 { 00025 FILE_LOG(logDEBUG1) << "---Hardroc2Chamber2 constructor id " << id << endl; 00026 00027 if ( difInfos.size() != 1 | 00028 boardInfos.size() != 2 | 00029 chipInfos.size() != 48) 00030 { 00031 FILE_LOG(logERROR)<< endl << "XML geometry error for chamber id[" << id << "] :Hardroc2Chamber2 must be composed of:\n" 00032 "-[1] dif." << endl << 00033 "-[2] board." << endl << 00034 "-[48] 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 else 00042 { 00043 description = "Hardroc2Chamber2"; 00044 type = HARDROC2CHAMBER2; 00045 init(id, difInfos, boardInfos, chipInfos); 00046 myIsValid = true; 00047 } 00048 }
Hardroc2Chamber2::~Hardroc2Chamber2 | ( | ) |
Definition at line 52 of file Hardroc2Chamber2.cpp.
00053 { 00054 //FILE_LOG(logDEBUG) << "---Hardroc2Chamber2 destructor"<< endl; 00055 }; // ~Hardroc2Chamber2
void Hardroc2Chamber2::print | ( | void | ) | const |
unsigned int Hardroc2Chamber2::getNumberOfBoards | ( | ) | const [inline] |
const float Hardroc2Chamber2::getXGap | ( | ) | const [inline, virtual] |
const float Hardroc2Chamber2::getYGap | ( | ) | const [inline, virtual] |
void Hardroc2Chamber2::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 74 of file Hardroc2Chamber2.cpp.
Referenced by Hardroc2Chamber2().
00077 { 00078 int bcol = 0; 00079 int brow = 0; 00080 00081 00082 00083 for (int difNum = 0 ; difNum < difInfos.size(); difNum++) 00084 { 00085 const DifInfo_t& difInfo = difInfos.at(difNum); 00086 if (difInfo.chamberId != this->getId()) 00087 { 00088 continue; 00089 } 00090 Dif *dif = new Dif(difInfo.id); 00091 00092 for (int boardNum = 0 ; boardNum < boardInfos.size(); boardNum++) 00093 { 00094 const BoardInfo_t& boardInfo = boardInfos.at(boardNum); 00095 if (boardInfo.difId != dif->getId() || boardInfo.chamberId != this->getId()) 00096 { 00097 continue; 00098 } 00099 00100 bcol= boardNum % 2; 00101 Hardroc2Board *board = new Hardroc2Board(*this,bcol , brow , 6, 4, boardInfo.id); 00102 00103 this->addDif(dif); 00104 dif->addBoard(board); 00105 this->addBoard(board); 00106 00107 00108 00109 int ccol = 0; 00110 int crow = 0; 00111 for (int chipNum = 0; chipNum < chipInfos.size(); chipNum++) 00112 { 00113 const ChipInfo_t& chipInfo = chipInfos.at(chipNum); 00114 if ((chipInfo.boardId != boardInfo.id) 00115 || (chipInfo.difId != difInfo.id) 00116 || (chipInfo.chamberId != id)) 00117 { 00118 continue; 00119 } 00120 FILE_LOG(logDEBUG1)<< " Detector.build : chip " << chipInfo.id << ", board " << chipInfo.boardId << endl; 00121 ccol= chipNum%6 ; 00122 00123 00124 Hardroc2Chip *chip = new Hardroc2Chip(*board, ccol, crow, chipInfo.id,chipInfo.serial); 00125 board->addChip(chip); 00126 00127 if (ccol == 5) { ++crow; } 00128 } 00129 FILE_LOG(logDEBUG1)<< " Detector.build : dif " << difInfo.id << ", chamber " << difInfo.chamberId << *this << endl; 00130 if ( bcol >= 1) { brow++ ; } 00131 } 00132 } 00133 }