00001 /* @version $Revision: 1328 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2011-10-03 17:04:17 +0200 (Mon, 03 Oct 2011) $ */ 00002 /* 00003 * File: ChipSoftId.cpp 00004 * Author: jacquem 00005 * 00006 * Created on May 8, 2010, 7:46 PM 00007 */ 00008 00009 #include "geometry/ChipSoftId.hh" 00010 00011 using namespace std; 00012 00013 00014 ChipSoftId::ChipSoftId():DifSoftId(), chipId (0), boardId(0) 00015 { 00016 } 00017 00018 ChipSoftId::ChipSoftId(const ChipSoftId& orig) 00019 { 00020 chamberId = orig.chamberId; 00021 difId = orig.difId; 00022 chipId = orig.chipId; 00023 boardId= orig.boardId; 00024 } 00025 00026 ChipSoftId::~ChipSoftId() 00027 { 00028 00029 } 00030 00031 void ChipSoftId::SetValue(unsigned int _chamberId, unsigned int _difId,unsigned int _boardId ,unsigned int _chipId) 00032 { 00033 DifSoftId::SetValue(_chamberId,_difId); 00034 chipId = _chipId; 00035 boardId = _boardId; 00036 } 00037 00038 00039 string ChipSoftId::toString( ) const 00040 { 00041 string result; 00042 stringstream sboardId, schipId; 00043 00044 result = DifSoftId::toString(); 00045 sboardId<<boardId; 00046 result+="asu["+sboardId.str() ; 00047 schipId<<chipId; 00048 result+="]chip["+schipId.str() + "]"; 00049 00050 return result; 00051 00052 } 00053 00054 long ChipSoftId::GetValue() const 00055 { 00056 return ( OFFSET_CHAMBER * GetChamberId() 00057 + OFFSET_DIF * GetDifId() 00058 + OFFSET_CHIP * chipId ) ; 00059 00060 }