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

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

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