/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/geometry/Hardroc2Chip.cpp

Go to the documentation of this file.
00001 /* @version $Revision: 1328 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2011-10-03 17:04:17 +0200 (Mon, 03 Oct 2011) $ */
00002   #include "geometry/Hardroc2Chip.hh"
00003 #include "geometry/Hardroc2Channel.hh"
00004 
00005 #include <iostream>
00006 #include "tools/Log.hh"
00007 
00008 using namespace std;
00009 
00010 //--------------------------//
00011 
00012 Hardroc2Chip::Hardroc2Chip(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 }; // Hardroc2Chip
00020 
00021 //--------------------------//
00022 void Hardroc2Chip::init()
00023 {
00024 //  FILE_LOG(logDEBUG) << "---Hardroc2Chip " << nbColumns << "cols, " << nbRows << " rows" << endl;
00025     for (int channelId = 0; channelId <= 63 ; channelId++) {
00026       int map = HRmap(channelId);
00027       //Hardroc2Channel *channel = new Hardroc2Channel(*this, map%8, map/8, channelId);
00028       Hardroc2Channel *channel = new Hardroc2Channel(*this, map/8, map%8, channelId);
00029       channels.insert(make_pair(channelId,channel));
00030     }
00031 }; // Hardroc2Chip.ini
00032 /*
00033 void Hardroc2Chip::init()
00034 {
00035 //  FILE_LOG(logDEBUG) << "---Hardroc2Chip " << nbColumns << "cols, " << nbRows << " rows" << endl;
00036   for (int lcol = 0; lcol < nbColumns; lcol++) {
00037     for (int lrow = 0; lrow < nbRows; lrow++) {
00038       int chId = lcol + lrow * nbColumns;
00039       Hardroc2Channel *channel = new Hardroc2Channel(*this, lcol, lrow, chId);
00040       channels.insert(make_pair(chId, channel));
00041     }
00042   }
00043 }; // Hardroc2Chip.init
00044 
00045 */
00046 
00047 
00048 
00049 //--------------- Channel MAPPING THANK TO ALEX D. !!!  -------------//
00050 int Hardroc2Chip::HRmap(int channel)
00051 {
00052 
00053 
00054   if(channel<0||channel>63)
00055   {
00056       FILE_LOG(logERROR)<<"map error  channel="<<channel<<endl;return-1;
00057   }
00058 
00059    const int map[64]=
00060   {7,  6,  5,  4,  3,  2,  1,   0,
00061    15, 14, 13, 12, 11, 10, 9 ,  8,
00062    23, 22 ,21 ,20 ,19, 18, 17, 16,
00063    31, 30, 29, 28, 27, 26, 25, 24,
00064    36, 37, 38, 39, 35, 34, 33, 32,
00065    44, 45, 46, 47, 43, 42, 41, 40,
00066    48, 49, 50, 51, 55, 54, 53, 52,
00067    56, 57, 58, 59, 60, 61, 62, 63};
00068 
00069   return map[channel];
00070 
00071   //the function throws a positin index: index%8 = xPad and index/8 = yPad
00072 
00073 
00074 }

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