00001
00002 #include "geometry/Hardroc2IPNLChip.hh"
00003 #include "geometry/Hardroc2IPNLChannel.hh"
00004
00005 #include <iostream>
00006 #include "tools/Log.hh"
00007
00008 using namespace std;
00009
00010
00011
00012 Hardroc2IPNLChip::Hardroc2IPNLChip(const Board& aBoard, const i32 aCol, const i32 aRow ,const i32 aId,const ui32 aSerialNumber)
00013 :Chip(aBoard, aCol, aRow, 8, 8, aId, aSerialNumber)
00014 {
00015 init();
00016 thresholdDac_0 = 0;
00017 thresholdDac_1 = 0;
00018 thresholdDac_2 = 0;
00019 };
00020
00021
00022 void Hardroc2IPNLChip::init()
00023 {
00024
00025 for (int channelId = 0; channelId <= 63 ; channelId++) {
00026 int map = HRmap(channelId);
00027 Hardroc2IPNLChannel *channel = new Hardroc2IPNLChannel(*this, map/8, map%8, channelId);
00028 channels.insert(make_pair(channelId,channel));
00029 }
00030 };
00031
00032
00033
00034 int Hardroc2IPNLChip::HRmap(int channel)
00035 {
00036
00037
00038 if(channel<0||channel>63)
00039 {
00040 FILE_LOG(logERROR)<<"map error channel="<<channel<<endl;return-1;
00041 }
00042
00043 const int map[64]=
00044 { 9 , 1 , 10, 2 , 11, 3 , 12, 4 ,
00045 5 , 13, 6 , 14, 7 , 15, 20, 19,
00046 18, 0 , 8 , 17, 16, 21, 22, 23,
00047 31, 30, 29, 28, 27, 26, 25, 24,
00048 32, 33, 34, 35, 36, 37, 38, 39,
00049 47, 46, 40, 48, 41, 49, 56, 42,
00050 43, 44, 45, 55, 63, 54, 62, 53,
00051 61, 52, 60, 59, 51, 58, 50, 57 };
00052 return map[channel];
00053
00054
00055
00056
00057 }