CMS 3D CMS Logo

EcalEBPhase2TPFormatter.cc
Go to the documentation of this file.
3 #include <iostream>
4 
6 
8 
9 void EcalEBPhase2TPFormatter::process(std::vector<int> &amp,
10  std::vector<int64_t> &time,
11  std::vector<int> &outEt,
12  std::vector<int64_t> &outTime) {
13  unsigned int size = amp.size();
14  outEt.resize(size);
15  outTime.resize(size);
16 
17  for (unsigned int i = 0; i < size; ++i) {
18  outEt[i] = amp[i];
19  outTime[i] = time[i];
20  }
21 
22  for (unsigned int i = 0; i < size; ++i) {
23  // this is the energy compression to 12 bits to go in the DF. To be done as last thing before building the TP
24  //Bit shift by 1 to go from 13 bits to 12
25  outEt[i] = outEt[i] >> 1;
26  if (outEt[i] > 0xFFF)
27  outEt[i] = 0xFFF;
28  }
29 
30  for (unsigned int i = 0; i < size; ++i) {
31  // this is the time compression to 5 bits to go in the DF.
32  outTime[i] = outTime[i] >> 6;
33  if (outTime[i] > 0xf)
34  outTime[i] = 0xf;
35  else if (outTime[i] < -0x10)
36  outTime[i] = -0x10;
37  }
38 }
size
Write out results.
virtual void process(std::vector< int > &ampl, std::vector< int64_t > &time, std::vector< int > &outampl, std::vector< int64_t > &outtime)
#define debug
Definition: HDRShower.cc:19