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
bool GetBypassed () const
void SetBypassed (bool value)
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 bypassed
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 32 of file MTChip.cpp.

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

MTChip::~MTChip (  )  [virtual]

Definition at line 39 of file MTChip.cpp.

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


Member Function Documentation

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

Definition at line 44 of file MTChip.cpp.

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

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

Definition at line 48 of file MTChip.hh.

Referenced by Info().

00048 { return id;};

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

Definition at line 49 of file MTChip.hh.

00049 { id = aValue ;};

UInt_t MTChip::GetSerialNumber (  )  const [inline]

Definition at line 51 of file MTChip.hh.

Referenced by main().

00051 { return serialNum;};

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

Definition at line 52 of file MTChip.hh.

00052 { serialNum = value;};

Int_t MTChip::GetGain (  )  const [inline]

Definition at line 54 of file MTChip.hh.

Referenced by main().

00054 { return gain; };

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

Definition at line 55 of file MTChip.hh.

00055 { gain = aValue; };

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

Definition at line 57 of file MTChip.hh.

00057 { return board; } ;

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

Definition at line 58 of file MTChip.hh.

00058 { board = value; } ; 

void MTChip::Info ( void   )  const

Reimplemented in MTDiracChip, MTHardroc1Chip, MTHardroc2Chip, and MTMicrorocChip.

Definition at line 86 of file MTChip.cpp.

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

bool MTChip::IsConfigured (  )  const [inline]

Definition at line 61 of file MTChip.hh.

00061 { return configured; };

bool MTChip::GetBypassed (  )  const [inline]

Definition at line 63 of file MTChip.hh.

00063 { return bypassed; };

void MTChip::SetBypassed ( bool  value  )  [inline]

Definition at line 64 of file MTChip.hh.

00064 { bypassed = value;};

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

Definition at line 66 of file MTChip.hh.

00066 { return softId;};

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

Definition at line 69 of file MTChip.hh.

00069 { return enableChannel[channelId]; };

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

Definition at line 70 of file MTChip.hh.

00070 { return enableChannel; };

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

Definition at line 71 of file MTChip.hh.

00071 { enableChannel[channelId] = aValue; };

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

Definition at line 73 of file MTChip.hh.

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

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

Definition at line 74 of file MTChip.hh.

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

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

Definition at line 76 of file MTChip.hh.

00076 { return stimulatedChannel[channelId]; };

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

Definition at line 77 of file MTChip.hh.

00077 { return stimulatedChannel; };

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

Definition at line 78 of file MTChip.hh.

00078 { stimulatedChannel[channelId] = aValue; };

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

Definition at line 80 of file MTChip.hh.

00080 { return pedestal_offset[channelId]; };

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

Definition at line 81 of file MTChip.hh.

00081 { return pedestal_offset; };

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

Definition at line 82 of file MTChip.hh.

00082 { 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::bypassed [private]

Definition at line 38 of file MTChip.hh.

Referenced by GetBypassed(), operator=(), and SetBypassed().

bool MTChip::stimulatedChannel[64] [private]

Definition at line 41 of file MTChip.hh.

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

bool MTChip::enableChannel[64] [private]

Definition at line 42 of file MTChip.hh.

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

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

Definition at line 43 of file MTChip.hh.

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

UInt_t MTChip::pedestal_offset[64] [private]

Definition at line 44 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 Jan 7 13:18:51 2013 for MicromegasFramework by  doxygen 1.4.7