CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalEBPhase2TPFormatter Class Reference

#include <EcalEBPhase2TPFormatter.h>

Public Member Functions

 EcalEBPhase2TPFormatter (bool debug)
 
virtual void process (std::vector< int > &ampl, std::vector< int64_t > &time, std::vector< int > &outampl, std::vector< int64_t > &outtime)
 
virtual ~EcalEBPhase2TPFormatter ()
 

Private Attributes

bool debug_
 
std::vector< int > inputAmp_
 
std::vector< int64_t > inputTime_
 

Detailed Description

Definition at line 14 of file EcalEBPhase2TPFormatter.h.

Constructor & Destructor Documentation

◆ EcalEBPhase2TPFormatter()

EcalEBPhase2TPFormatter::EcalEBPhase2TPFormatter ( bool  debug)

Definition at line 5 of file EcalEBPhase2TPFormatter.cc.

5 : debug_(debug) {}
#define debug
Definition: HDRShower.cc:19

◆ ~EcalEBPhase2TPFormatter()

EcalEBPhase2TPFormatter::~EcalEBPhase2TPFormatter ( )
virtual

Definition at line 7 of file EcalEBPhase2TPFormatter.cc.

7 {}

Member Function Documentation

◆ process()

void EcalEBPhase2TPFormatter::process ( std::vector< int > &  ampl,
std::vector< int64_t > &  time,
std::vector< int > &  outampl,
std::vector< int64_t > &  outtime 
)
virtual

Definition at line 9 of file EcalEBPhase2TPFormatter.cc.

References mps_fire::i, findQualityFiles::size, and hcalRecHitTable_cff::time.

Referenced by EcalEBPhase2TrigPrimAlgo::run().

12  {
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.

Member Data Documentation

◆ debug_

bool EcalEBPhase2TPFormatter::debug_
private

Definition at line 16 of file EcalEBPhase2TPFormatter.h.

◆ inputAmp_

std::vector<int> EcalEBPhase2TPFormatter::inputAmp_
private

Definition at line 17 of file EcalEBPhase2TPFormatter.h.

◆ inputTime_

std::vector<int64_t> EcalEBPhase2TPFormatter::inputTime_
private

Definition at line 18 of file EcalEBPhase2TPFormatter.h.