/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/root/MTChipSoftId.cpp

Go to the documentation of this file.
00001 /* @version $Revision: 1742 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-05-29 16:34:39 +0200 (Tue, 29 May 2012) $ */
00002 /* 
00003  * File:   ChipSoftId.cpp
00004  * Author: jacquem
00005  * 
00006  * Created on May 8, 2010, 7:46 PM
00007  */
00008 
00009 #include "root/MTChipSoftId.hh"
00010 //#include "root/TreeClass.hh"
00011 
00012 
00013 using namespace std;
00014 
00015 ClassImp(MTChipSoftId);
00016 /* 
00017  * File:   ChipSoftId.cpp
00018  * Author: jacquem
00019  * 
00020  * Created on May 8, 2010, 7:46 PM
00021  */
00022 
00023 
00024 using namespace std;
00025 
00026 
00027 MTChipSoftId::MTChipSoftId():MTDifSoftId(), chipId (0), boardId(0), chipSerialNumber(0) , chipRow(0) ,chipCol(0), boardCol(0), boardRow(0), nbChipByBoardCol(0), nbChipByBoardRow(0),nbChannelByChipCol(0), nbChannelByChipRow(0)
00028 {
00029 }
00030 
00031 
00032 MTChipSoftId::MTChipSoftId(const MTChipSoftId& orig)
00033 {
00034                 chamberId = orig.chamberId;
00035                 difId = orig.difId;
00036                 chipId = orig.chipId;
00037                 boardId= orig.boardId;
00038     chipSerialNumber = orig.chipSerialNumber;
00039     chipRow = orig.chipRow;
00040     chipCol = orig.chipCol;
00041     boardCol = orig.boardCol;
00042     boardRow = orig.boardRow;
00043     nbChipByBoardCol = orig.nbChipByBoardCol;
00044     nbChipByBoardRow = orig.nbChipByBoardRow;
00045     nbChannelByChipCol = orig.nbChannelByChipCol;
00046     nbChannelByChipRow = orig.nbChannelByChipRow;
00047 
00048 }
00049 
00050 MTChipSoftId::~MTChipSoftId()
00051 {
00052 
00053 }
00054 
00055 void MTChipSoftId::SetValue(unsigned int _chamberId,unsigned int _difId, unsigned int _boardId, unsigned int _boardRow,unsigned int  _boardCol,unsigned int _nbChipByBoardRow,  unsigned int _nbChipByBoardCol,   unsigned int _chipId, unsigned int _chipRow,unsigned int  _chipCol,unsigned int _nbChannelByChipRow , unsigned int _nbChannelByChipCol, unsigned int _chipSerialNumber)
00056 {
00057                 MTDifSoftId::SetValue(_chamberId,_difId);
00058                 chipId = _chipId;
00059                 boardId = _boardId;
00060     chipSerialNumber = _chipSerialNumber;
00061     chipRow = _chipRow;
00062     chipCol = _chipCol;
00063     boardRow = _boardRow;
00064     boardCol = _boardCol;
00065     nbChipByBoardCol = _nbChipByBoardCol;
00066     nbChipByBoardRow =_nbChipByBoardRow;
00067     nbChannelByChipCol = _nbChannelByChipCol;
00068     nbChannelByChipRow = _nbChannelByChipRow;
00069 
00070     
00071 }
00072 
00073 
00074 string MTChipSoftId::toString( ) const
00075 {
00076          string result;
00077    stringstream sboardId, schipId, sSerialNum, sChipRow, sChipCol, sBoardRow,sBoardCol; 
00078 
00079          result =  MTDifSoftId::toString();
00080 
00081          sboardId<<boardId;
00082    result+="asu["+sboardId.str() ;
00083 
00084          sBoardRow <<boardRow;
00085    result+="]board row ["+sBoardRow.str() + "]";
00086 
00087          sBoardCol <<boardCol;
00088    result+="]board Col ["+sBoardCol.str() + "]";
00089 
00090          schipId<<chipId;
00091    result+="]chip["+schipId.str() + "]";
00092 
00093          sSerialNum<<chipSerialNumber;
00094    result+="]serial Num["+sSerialNum.str() + "]";
00095 
00096          sChipRow <<chipRow;
00097    result+="]chip row ["+sChipRow.str() + "]";
00098 
00099          sChipCol <<chipCol;
00100    result+="]chip Col ["+sChipCol.str() + "]";
00101 
00102          return result;
00103 
00104 }
00105 
00106  long MTChipSoftId::GetValue() const
00107  {
00108                  return  ( OFFSET_CHAMBER * GetChamberId()
00109                + OFFSET_DIF *  GetDifId()
00110                + OFFSET_CHIP *  chipId ) ;
00111 }

Generated on Mon Jan 7 13:15:22 2013 for MicromegasFramework by  doxygen 1.4.7