Commit d1565a28 authored by Sarah Seif El Nasr's avatar Sarah Seif El Nasr
Browse files

Still trying to find where all the instances of chip --> readoutChip.

parent 9824077e
......@@ -116,46 +116,4 @@ namespace Ph2_HwDescription {
return false;
}
}
// // #################
// // # RD53 specific #
// // #################
// bool Module::removeRD53 (uint8_t pRD53Id)
// {
// std::vector < RD53* > :: iterator i;
// bool found = false;
// for (i = fRD53Vector.begin(); i != fRD53Vector.end(); ++i)
// {
// if ((*i)->getRD53Id() == pRD53Id)
// {
// found = true;
// break;
// }
// }
// if (found)
// {
// fRD53Vector.erase (i);
// return true;
// }
// else
// {
// LOG (INFO) << "Error:The Module " << +fModuleId << " doesn't have the RD53 " << +pRD53Id;
// return false;
// }
// }
// RD53* Module::getRD53 (uint8_t pRD53Id) const
// {
// for (RD53* c : fRD53Vector)
// {
// if (c->getRD53Id() == pRD53Id)
// return c;
// }
// return nullptr;
// }
// // #################
}
......@@ -14,6 +14,7 @@
#include "FrontEndDescription.h"
// #include "RD53.h"
#include "ReadoutChip.h"
#include "Chip.h"
#include "MPA.h"
#include "SSA.h"
......@@ -51,23 +52,6 @@ namespace Ph2_HwDescription {
// D'tor
~Module()
{
// for ( auto& pChip : fChipVector )
// if (pChip) delete pChip;
// fChipVector.clear();
// for ( auto& pMPA : fMPAVector )
// delete pMPA;
// for ( auto& pSSA : fSSAVector )
// delete pSSA;
// fMPAVector.clear();
// for ( auto& pRD53 : fRD53Vector )
// if (pRD53) delete pRD53;
// fRD53Vector.clear();
};
/*!
......@@ -76,16 +60,11 @@ namespace Ph2_HwDescription {
*/
void accept ( HwDescriptionVisitor& pVisitor )
{
pVisitor.visit ( *this );
for ( Chip* cChip : fChipVector )
cChip->accept ( pVisitor );
pVisitor.visit ( *this );
for ( Chip* cChip : fChipVector )
cChip->accept ( pVisitor );
}
// void accept( HwDescriptionVisitor& pVisitor ) const {
// pVisitor.visit( *this );
// for ( auto& cChip : fChipVector )
// cChip.accept( pVisitor );
// }
/*!
* \brief Get the number of Chip connected to the Module
* \return The size of the vector
......@@ -142,6 +121,40 @@ namespace Ph2_HwDescription {
fChipVector.push_back ( pChip );
}
void addReadoutChip ( ReadoutChip& pChip )
{
//get the FrontEndType of the Chip and set the module one accordingly
//this is the case when no chip type has been set so get the one from the Chip
if (fType == FrontEndType::UNDEFINED)
fType = pChip.getFrontEndType();
//else, the chip type has already been set - if it is different from another Chip, rais a warning
//no different chips should be on a module
else if (fType != pChip.getFrontEndType() )
{
LOG (ERROR) << "Error, Chips of a module should not be of different type! - aborting";
exit (1);
}
fReadoutChipVector.push_back ( &pChip );
}
void addReadoutChip ( ReadoutChip* pChip )
{
//get the FrontEndType of the Chip and set the module one accordingly
//this is the case when no chip type has been set so get the one from the Chip
if (fType == FrontEndType::UNDEFINED)
fType = pChip->getFrontEndType();
//else, the chip type has already been set - if it is different from another Chip, rais a warning
//no different chips should be on a module
else if (fType != pChip->getFrontEndType() )
{
LOG (ERROR) << "Error, Chips of a module should not be of different type! - aborting";
exit (1);
}
fReadoutChipVector.push_back ( pChip );
}
void addMPA ( MPA& pMPA )
{
......@@ -277,6 +290,7 @@ namespace Ph2_HwDescription {
// std::vector < RD53* > fRD53Vector;
std::vector < ReadoutChip* > fReadoutChipVector;
std::vector < Chip* > fChipVector;
std::vector < MPA* > fMPAVector;
std::vector < SSA* > fSSAVector;
......
......@@ -9,8 +9,8 @@
*/
#ifndef __CHIPINTERFACE_H__
#define __CHIPINTERFACE_H__
#ifndef __READOUTCHIPINTERFACE_H__
#define __READOUTCHIPINTERFACE_H__
#include <vector>
//#include "../HWInterface/GlibFWInterface.h"
......
......@@ -150,7 +150,7 @@ namespace Ph2_System {
fBeBoardInterface = new BeBoardInterface ( fBeBoardFWMap );
if (fBoardVector[0]->getBoardType() != BoardType::FC7)
fChipInterface = new CbcInterface ( fBeBoardFWMap );
fReadoutChipInterface = new CbcInterface ( fBeBoardFWMap );
else
fChipInterface = new RD53Interface ( fBeBoardFWMap );
fMPAInterface = new MPAInterface ( fBeBoardFWMap );
......
......@@ -14,6 +14,7 @@
#define __SYSTEMCONTROLLER_H__
#include "../System/FileParser.h"
#include "../HWInterface/ReadoutChipInterface.h"
#include "../HWInterface/ChipInterface.h"
#include "../HWInterface/RD53Interface.h"
#include "../HWInterface/MPAInterface.h"
......@@ -62,6 +63,7 @@ namespace Ph2_System {
{
public:
BeBoardInterface* fBeBoardInterface; //!< Interface to the BeBoard
ReadoutChipInterface* fReadoutChipInterface;
ChipInterface* fChipInterface; //!< Interface to the CBC
SSAInterface* fSSAInterface; //!< Interface to the SSA
MPAInterface* fMPAInterface; //!< Interface to the MPA
......
......@@ -930,7 +930,7 @@ void Tool::bitWiseScanBeBoard(uint16_t boardIndex, const std::string &dacName, c
DetectorContainer *outputDataContainer = fDetectorDataContainer;
float globalOccupancy = 0.;
Chip *cChip = static_cast<BeBoard*>(fDetectorContainer->at(boardIndex))->fModuleVector.at(0)->fChipVector.at(0); //assumption: one BeBoard has only one type of chip;
ReadoutChip *cChip = static_cast<BeBoard*>(fDetectorContainer->at(boardIndex))->fModuleVector.at(0)->fReadoutChipVector.at(0); //assumption: one BeBoard has only one type of chip;
bool localDAC = cChip->isDACLocal(dacName);
uint8_t numberOfBits = cChip->getNumberOfBits(dacName);
......@@ -1240,7 +1240,7 @@ void Tool::setSameLocalDacBeBoard(BeBoard* pBoard, const std::string &dacName, c
{
for ( auto cFe : pBoard->fModuleVector )
{
for ( auto cChip : cFe->fChipVector )
for ( auto cChip : cFe->fReadoutChipVector )
{
ChannelContainer<RegisterValue>* dacVector = new ChannelContainer<RegisterValue>(cChip->getNumberOfChannels(),RegisterValue(dacValue));
ChipContainer theChipContainer(cChip->getId(),cChip->getNumberOfRows(),cChip->getNumberOfCols());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment