MTChip Class Reference

#include <MTChip.hh>

Inheritance diagram for MTChip:

Inheritance graph
[legend]
Collaboration diagram for MTChip:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MTChip (UInt_t id=0)
 MTChip (const Chip &aChip)
virtual ~MTChip ()
MTChipoperator= (const Chip &aChip)
UInt_t GetId () const
void SetId (UInt_t aValue)
UInt_t GetSerialNumber () const
void SetSerialNumber (UInt_t value)
Int_t GetGain () const
void SetGain (Int_t aValue)
MTBoardGetBoard (void)
void SetBoard (MTBoard &value)
void Info (void) const
bool IsConfigured () const
const MTChipSoftIdGetSoftId () const
bool GetEnableChannel (UInt_t channelId) const
const bool * GetEnableChannels () const
void SetEnableChannel (UInt_t channelId, bool aValue)
bool GetMaskChannel (UInt_t channelId, UInt_t index) const
void SetMaskChannel (UInt_t channelId, UInt_t index, bool aValue)
bool GetStimulatedChannel (UInt_t channelId) const
const bool * GetStimulatedChannels () const
void SetStimulatedChannel (UInt_t channelId, bool aValue)
UInt_t GetPedestalChannel (UInt_t channelId) const
const UInt_t * GetPedestalChannels () const
void SetPedestalChannel (UInt_t channelId, UInt_t aValue)

Private Attributes

UInt_t id
MTChipSoftId softId
MTBoard board
UInt_t serialNum
Int_t gain
bool configured
bool stimulatedChannel [64]
bool enableChannel [64]
bool maskChannel [64][3]
UInt_t pedestal_offset [64]

Detailed Description

CLASS MTCHIP(containing chip configuration)

Definition at line 21 of file MTChip.hh.


Constructor & Destructor Documentation

MTChip::MTChip ( UInt_t  id = 0  ) 

MTChip::MTChip ( const Chip aChip  ) 

Definition at line 31 of file MTChip.cpp.

00032 {
00033  (*this) = aChip;  // appel de l'operateur de copie
00034 }

MTChip::~MTChip (  )  [virtual]

Definition at line 38 of file MTChip.cpp.

00039 {
00040 //      cout << "DEBUG MTChip destructeur" <<endl;
00041 }


Member Function Documentation

MTChip & MTChip::operator= ( const Chip aChip  ) 

Definition at line 43 of file MTChip.cpp.

00044 {
00045         const Board& board = aChip.getBoard() ;
00046         const Dif* dif = board.getDif();
00047         unsigned int difId = 0;
00048         if ( dif != NULL) difId = dif->getId();
00049         const Chamber& cham = board.getChamber();
00050 
00051         softId.SetValue(cham.getId(), difId, aChip.getBoard().getId(),aChip.getBoard().getRow(),aChip.getBoard().getColumn(), aChip.getBoard().getNbRows(), aChip.getBoard().getNbColumns(), aChip.getId(), aChip.getRow(), aChip.getNbRows(), aChip.getNbColumns(),  aChip.getColumn(),  aChip.getSerialNumber());
00052 
00053         id = aChip.getId();
00054   serialNum      = aChip.getSerialNumber();
00055   gain = aChip.getGain();
00056   configured = aChip.isConfigured();
00057 
00058   ChannelMap_t channels = aChip.getChannels();  // get channel list for corrersponding Chip
00059   for (ChannelMap_t::const_iterator channelIt = channels.begin(); channelIt != channels.end(); channelIt++)
00060   {
00061      const Channel& channel = *(channelIt->second);
00062 
00063      enableChannel[channel.getHardId()]     = channel.getEnable();
00064 
00065      stimulatedChannel[channel.getHardId()] = channel.getStimulate();
00066 
00067      pedestal_offset[channel.getHardId()] = channel.getPedestalOffset();
00068 
00069      enableChannel[channel.getHardId()]     = channel.getEnable();
00070      try 
00071      {
00072        const MicrorocChannel& mc = dynamic_cast<const MicrorocChannel&> (channel) ;
00073        for ( unsigned int i = 0 ; i <= 2 ; i++ )
00074        {
00075          maskChannel[channel.getHardId()][i] = mc.getMask(i);
00076        }
00077      }
00078      catch ( ... )  {}
00079   }
00080         return *this;
00081 }

UInt_t MTChip::GetId ( void   )  const [inline]

Definition at line 47 of file MTChip.hh.

Referenced by Info().

00047 { return id;};

void MTChip::SetId ( UInt_t  aValue  )  [inline]

Definition at line 48 of file MTChip.hh.

00048 { id = aValue ;};

UInt_t MTChip::GetSerialNumber (  )  const [inline]

Definition at line 50 of file MTChip.hh.

Referenced by main().

00050 { return serialNum;};

void MTChip::SetSerialNumber ( UInt_t  value  )  [inline]

Definition at line 51 of file MTChip.hh.

00051 { serialNum = value;};

Int_t MTChip::GetGain (  )  const [inline]

Definition at line 53 of file MTChip.hh.

Referenced by main().

00053 { return gain; };

void MTChip::SetGain ( Int_t  aValue  )  [inline]

Definition at line 54 of file MTChip.hh.

00054 { gain = aValue; };

MTBoard& MTChip::GetBoard ( void   )  [inline]

Definition at line 56 of file MTChip.hh.

00056 { return board; } ;

void MTChip::SetBoard ( MTBoard value  )  [inline]

Definition at line 57 of file MTChip.hh.

00057 { board = value; } ; 

void MTChip::Info ( void   )  const

Reimplemented in MTDiracChip, MTHardroc1Chip, MTHardroc2Chip, and MTMicrorocChip.

Definition at line 84 of file MTChip.cpp.

00085 {
00086    cout << "------------ Chip[" << this->GetId() << "] on Dif[" << softId.GetDifId() <<"] configuration ---------------" << endl ;
00087 
00088    int index = 0;
00089    cout << "Enable channel:" << endl;
00090    for ( UInt_t num = 0; num <=63 ; num++)
00091    {
00092        cout << "[" << index++ << ":" << enableChannel[num]  << "]";
00093    }
00094    cout << endl;
00095    index = 0;
00096    cout << "stimulated value:" << endl;
00097    for ( UInt_t num = 0; num <=63 ; num++)
00098    {
00099        cout << "[" << index++ << ":" << stimulatedChannel[num]  << "]";
00100    }
00101 
00102    cout << endl;
00103    cout << endl;
00104    index = 0;
00105    cout << "pedestal value:" << endl;
00106    //for(vector<UInt_t>::const_iterator ii=pedestal_offset.begin(); ii!=pedestal_offset.end(); ++ii)
00107    for ( UInt_t num = 0; num <=63 ; num++)
00108    {
00109        //cout << "[" <<  index++ << ":" << *(ii) << "]";
00110        cout << "[" <<  index++ << ":" << pedestal_offset[num] << "]";
00111 
00112    }
00113    cout << endl;
00114 
00115    cout << "gain = " << gain << endl;
00116    cout << "serial number:[" << serialNum  << endl;
00117 }

bool MTChip::IsConfigured (  )  const [inline]

Definition at line 60 of file MTChip.hh.

00060 { return configured; };

const MTChipSoftId& MTChip::GetSoftId (  )  const [inline]

Definition at line 62 of file MTChip.hh.

00062 { return softId;};

bool MTChip::GetEnableChannel ( UInt_t  channelId  )  const [inline]

Definition at line 65 of file MTChip.hh.

00065 { return enableChannel[channelId]; };

const bool* MTChip::GetEnableChannels (  )  const [inline]

Definition at line 66 of file MTChip.hh.

00066 { return enableChannel; };

void MTChip::SetEnableChannel ( UInt_t  channelId,
bool  aValue 
) [inline]

Definition at line 67 of file MTChip.hh.

00067 { enableChannel[channelId] = aValue; };

bool MTChip::GetMaskChannel ( UInt_t  channelId,
UInt_t  index 
) const [inline]

Definition at line 69 of file MTChip.hh.

00069 { return maskChannel[channelId][index]; };

void MTChip::SetMaskChannel ( UInt_t  channelId,
UInt_t  index,
bool  aValue 
) [inline]

Definition at line 70 of file MTChip.hh.

00070 { maskChannel[channelId][index] = aValue; };

bool MTChip::GetStimulatedChannel ( UInt_t  channelId  )  const [inline]

Definition at line 72 of file MTChip.hh.

00072 { return stimulatedChannel[channelId]; };

const bool* MTChip::GetStimulatedChannels (  )  const [inline]

Definition at line 73 of file MTChip.hh.

00073 { return stimulatedChannel; };

void MTChip::SetStimulatedChannel ( UInt_t  channelId,
bool  aValue 
) [inline]

Definition at line 74 of file MTChip.hh.

00074 { stimulatedChannel[channelId] = aValue; };

UInt_t MTChip::GetPedestalChannel ( UInt_t  channelId  )  const [inline]

Definition at line 76 of file MTChip.hh.

00076 { return pedestal_offset[channelId]; };

const UInt_t* MTChip::GetPedestalChannels (  )  const [inline]

Definition at line 77 of file MTChip.hh.

00077 { return pedestal_offset; };

void MTChip::SetPedestalChannel ( UInt_t  channelId,
UInt_t  aValue 
) [inline]

Definition at line 78 of file MTChip.hh.

00078 { pedestal_offset[channelId] = aValue; };


Member Data Documentation

UInt_t MTChip::id [private]

Definition at line 31 of file MTChip.hh.

Referenced by GetId().

MTChipSoftId MTChip::softId [private]

Definition at line 32 of file MTChip.hh.

Referenced by GetSoftId(), Info(), and operator=().

MTBoard MTChip::board [private]

Definition at line 34 of file MTChip.hh.

Referenced by GetBoard(), operator=(), and SetBoard().

UInt_t MTChip::serialNum [private]

Definition at line 35 of file MTChip.hh.

Referenced by GetSerialNumber(), Info(), operator=(), and SetSerialNumber().

Int_t MTChip::gain [private]

Definition at line 36 of file MTChip.hh.

Referenced by GetGain(), Info(), operator=(), and SetGain().

bool MTChip::configured [private]

Definition at line 37 of file MTChip.hh.

Referenced by IsConfigured(), and operator=().

bool MTChip::stimulatedChannel[64] [private]

Definition at line 40 of file MTChip.hh.

Referenced by GetStimulatedChannel(), GetStimulatedChannels(), Info(), operator=(), and SetStimulatedChannel().

bool MTChip::enableChannel[64] [private]

Definition at line 41 of file MTChip.hh.

Referenced by GetEnableChannel(), GetEnableChannels(), Info(), operator=(), and SetEnableChannel().

bool MTChip::maskChannel[64][3] [private]

Definition at line 42 of file MTChip.hh.

Referenced by GetMaskChannel(), operator=(), and SetMaskChannel().

UInt_t MTChip::pedestal_offset[64] [private]

Definition at line 43 of file MTChip.hh.

Referenced by GetPedestalChannel(), GetPedestalChannels(), Info(), operator=(), and SetPedestalChannel().


The documentation for this class was generated from the following files:
Generated on Mon Jun 11 16:58:52 2012 for MicromegasFramework by  doxygen 1.4.7