Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixEtTot.h>
0002 
0003 //----------------------------------------------------------------------------------------
0004 EcalFenixEtTot::EcalFenixEtTot() {}
0005 //----------------------------------------------------------------------------------------
0006 EcalFenixEtTot::~EcalFenixEtTot() {}
0007 //----------------------------------------------------------------------------------------
0008 std::vector<int> EcalFenixEtTot::process(const std::vector<EBDataFrame *> &calodatafr) {
0009   std::vector<int> out;
0010   return out;
0011 }
0012 //----------------------------------------------------------------------------------------
0013 void EcalFenixEtTot::process(std::vector<std::vector<int>> &bypasslinout,
0014                              int nStr,
0015                              int bitMask,
0016                              int bitOddEven,
0017                              std::vector<int> &output_even,
0018                              std::vector<int> &output_odd) {
0019   for (unsigned int i = 0; i < output_even.size(); i++) {
0020     output_even[i] = 0;
0021     output_odd[i] = 0;
0022   }
0023 
0024   int mask = (1 << bitMask) - 1;
0025   for (int istrip = 0; istrip < nStr; istrip++) {
0026     for (unsigned int i = 0; i < bypasslinout[istrip].size(); i++) {
0027       int output = (bypasslinout[istrip][i] & mask);  // fix bug inn case of EE: MSB are set for FG, so
0028                                                       // need to apply mask in summation.
0029       if (output > mask)
0030         output = mask;
0031       // Check the oddeven flag to assign the amplitude to the correct sum
0032       // If the feature is off in the strip fenix the bit will be always 0 and only the even sum will be summed
0033       if ((bypasslinout[istrip][i] >> bitOddEven) & 1) {
0034         output_odd[i] += output;
0035       } else {
0036         output_even[i] += output;
0037       }
0038     }
0039   }
0040   return;
0041 }
0042 //----------------------------------------------------------------------------------------