Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:28

0001 #ifndef SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALFENIXMAXOF2_H
0002 #define SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALFENIXMAXOF2_H
0003 
0004 #include <vector>
0005 
0006 /**
0007  *  finds max sum of two adjacent samples
0008  *
0009  *  input: 5x 12 bits (les 12 premiers bits sortant du bypasslin)
0010  *  output: 12 bits
0011  *
0012  *  computes 4 sums of 2 strips and gives the max
0013  *  max limited by 0xfff
0014  *
0015  * As in the firmware the computation is performed only on the even energy sum,
0016  * so the oddEvenFlag (14th bit) is used to exclude the energy of the odd strips from the computation. D.Valsecchi.
0017  *
0018  */
0019 
0020 class EcalFenixMaxof2 {
0021 public:
0022   EcalFenixMaxof2(int maxNrSamples, int nbMaxStrips);
0023   virtual ~EcalFenixMaxof2();
0024   void process(std::vector<std::vector<int>> &, int nStr, int bitMask, int bitOddEven, std::vector<int> &out);
0025 
0026 private:
0027   int nbMaxStrips_;
0028   std::vector<std::vector<int>> sumby2_;
0029 };
0030 
0031 #endif