Hardroc2Chamber1 Class Reference

#include <Hardroc2Chamber1.hh>

Inheritance diagram for Hardroc2Chamber1:

Inheritance graph
[legend]
Collaboration diagram for Hardroc2Chamber1:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Hardroc2Chamber1 (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)
 ~Hardroc2Chamber1 ()
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 18 of file Hardroc2Chamber1.hh.


Constructor & Destructor Documentation

Hardroc2Chamber1::Hardroc2Chamber1 ( 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 Hardroc2Chamber1.cpp.

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

Hardroc2Chamber1::~Hardroc2Chamber1 (  ) 

Definition at line 54 of file Hardroc2Chamber1.cpp.

00055 {
00056   //FILE_LOG(logDEBUG) << "---Hardroc2Chamber1 destructor"<< endl;
00057 }; // ~Hardroc2Chamber1


Member Function Documentation

void Hardroc2Chamber1::print ( void   )  const

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

Reimplemented from Chamber.

Definition at line 29 of file Hardroc2Chamber1.hh.

00029 { return 1; }

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

Implements Chamber.

Definition at line 31 of file Hardroc2Chamber1.hh.

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

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

Implements Chamber.

Definition at line 32 of file Hardroc2Chamber1.hh.

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

void Hardroc2Chamber1::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 77 of file Hardroc2Chamber1.cpp.

Referenced by Hardroc2Chamber1().

00080 {
00081 // Verify XML geometry
00082 int bcol = 0;
00083 int brow = 0;
00084 int index = 0;
00085 
00086 for (int difNum = 0 ; difNum < difInfos.size(); difNum++)
00087 {
00088    const DifInfo_t& difInfo =  difInfos.at(difNum);
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() )
00096        {
00097            continue;
00098        }
00099 
00100         Hardroc2Board *board = new Hardroc2Board(*this,0 , 0 , 6, 4, boardInfo.id);
00101 
00102         this->addDif(dif);
00103         dif->addBoard(board);
00104         this->addBoard(board);
00105 
00106         int ccol = 0;
00107         int crow = 0;
00108         for (int chipNum = 0; chipNum < chipInfos.size(); chipNum++)
00109         {
00110             const ChipInfo_t& chipInfo = chipInfos.at(chipNum);
00111             if ((chipInfo.boardId != boardInfo.id)
00112                  || (chipInfo.difId != difInfo.id))
00113             {
00114               continue;
00115             }
00116             FILE_LOG(logDEBUG1)<< "      Detector.build : chip " << chipInfo.id << ", board " << chipInfo.boardId << endl;
00117             ccol=  chipNum%6 ;
00118 
00119 
00120             Hardroc2Chip *chip = new Hardroc2Chip(*board, ccol, crow, chipInfo.id,chipInfo.serial);
00121             board->addChip(chip);
00122 
00123             if (ccol == 5) { ++crow; }
00124         }
00125         FILE_LOG(logDEBUG1)<< "  Detector.build : dif " << difInfo.id << ", chamber " << difInfo.chamberId << *this << endl;
00126         if ( brow >= 1) { bcol++ ; }
00127      }
00128 }
00129 }


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