Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:00:20

0001 // -*- C++ -*-
0002 //
0003 // Package:    EventFilter/SiStripRawToDigi
0004 //
0005 /*
0006  Description: handles conversion of pipeline address to temporal location using a look-up table
0007 */
0008 //
0009 // Original Author:  A.-M. Magnan
0010 //         Created:  2009/11/23
0011 //
0012 
0013 #ifndef EventFilter_SiStripRawToDigi_PipeAddrToTimeLookupTable_H
0014 #define EventFilter_SiStripRawToDigi_PipeAddrToTimeLookupTable_H
0015 
0016 #include "EventFilter/SiStripRawToDigi/interface/SiStripFEDBufferComponents.h"
0017 
0018 namespace sistrip {
0019 
0020   //pipeline address for a given timeLocation (number between 0 and 191)
0021   //return a number between 0 and 255
0022   static const uint8_t PIPEADDR[APV_MAX_ADDRESS] = {
0023       48,  49,  51,  50,  54,  55,  53,  52,  60,  61,  63,  62,  58,  59,  57,  56,  40,  41,  43,  42,  46,  47,
0024       45,  44,  36,  37,  39,  38,  34,  35,  33,  32,  96,  97,  99,  98,  102, 103, 101, 100, 108, 109, 111, 110,
0025       106, 107, 105, 104, 120, 121, 123, 122, 126, 127, 125, 124, 116, 117, 119, 118, 114, 115, 113, 112, 80,  81,
0026       83,  82,  86,  87,  85,  84,  92,  93,  95,  94,  90,  91,  89,  88,  72,  73,  75,  74,  78,  79,  77,  76,
0027       68,  69,  71,  70,  66,  67,  65,  64,  192, 193, 195, 194, 198, 199, 197, 196, 204, 205, 207, 206, 202, 203,
0028       201, 200, 216, 217, 219, 218, 222, 223, 221, 220, 212, 213, 215, 214, 210, 211, 209, 208, 240, 241, 243, 242,
0029       246, 247, 245, 244, 252, 253, 255, 254, 250, 251, 249, 248, 232, 233, 235, 234, 238, 239, 237, 236, 228, 229,
0030       231, 230, 226, 227, 225, 224, 160, 161, 163, 162, 166, 167, 165, 164, 172, 173, 175, 174, 170, 171, 169, 168,
0031       184, 185, 187, 186, 190, 191, 189, 188, 180, 181, 183, 182, 178, 179, 177, 176};
0032   //timeLoc for a given pipeline address (number between 0 and 255)
0033   //return a number between 0 and 191 if valid.
0034   //set 200 as invalid value.
0035   static const uint8_t TIMELOC[256] = {
0036       200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
0037       200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 31,  30,  28,  29,  24,  25,  27,  26,  16,  17,  19,  18,
0038       23,  22,  20,  21,  0,   1,   3,   2,   7,   6,   4,   5,   15,  14,  12,  13,  8,   9,   11,  10,  95,  94,
0039       92,  93,  88,  89,  91,  90,  80,  81,  83,  82,  87,  86,  84,  85,  64,  65,  67,  66,  71,  70,  68,  69,
0040       79,  78,  76,  77,  72,  73,  75,  74,  32,  33,  35,  34,  39,  38,  36,  37,  47,  46,  44,  45,  40,  41,
0041       43,  42,  63,  62,  60,  61,  56,  57,  59,  58,  48,  49,  51,  50,  55,  54,  52,  53,  200, 200, 200, 200,
0042       200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
0043       200, 200, 200, 200, 200, 200, 160, 161, 163, 162, 167, 166, 164, 165, 175, 174, 172, 173, 168, 169, 171, 170,
0044       191, 190, 188, 189, 184, 185, 187, 186, 176, 177, 179, 178, 183, 182, 180, 181, 96,  97,  99,  98,  103, 102,
0045       100, 101, 111, 110, 108, 109, 104, 105, 107, 106, 127, 126, 124, 125, 120, 121, 123, 122, 112, 113, 115, 114,
0046       119, 118, 116, 117, 159, 158, 156, 157, 152, 153, 155, 154, 144, 145, 147, 146, 151, 150, 148, 149, 128, 129,
0047       131, 130, 135, 134, 132, 133, 143, 142, 140, 141, 136, 137, 139, 138};
0048 
0049   class FEDAddressConversion {
0050   public:
0051     static const uint8_t pipelineAddress(const uint8_t aTimeLocation);
0052     static const uint8_t timeLocation(const uint8_t aPipelineAddress);
0053 
0054   private:
0055   };
0056 
0057   //FEDAddressConversion
0058 
0059   inline const uint8_t FEDAddressConversion::pipelineAddress(const uint8_t aTimeLocation) {
0060     if (aTimeLocation < APV_MAX_ADDRESS)
0061       return PIPEADDR[aTimeLocation];
0062     else
0063       return 0;
0064   }
0065 
0066   inline const uint8_t FEDAddressConversion::timeLocation(const uint8_t aPipelineAddress) {
0067     return TIMELOC[aPipelineAddress];
0068   }
0069 
0070 }  // namespace sistrip
0071 #endif