CMS 3D CMS Logo

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

#include <EcalFenixTcpFormatEB.h>

Public Member Functions

 EcalFenixTcpFormatEB (bool tccFormat, bool debug, bool famos, int binOfMax)
 
virtual std::vector< int > process (const std::vector< int > &, const std::vector< int > &)
 
void process (std::vector< int > &Et_even_sum, std::vector< int > &Et_odd_sum, std::vector< int > &fgvb, std::vector< int > &sfgvb, int eTTotShift, std::vector< EcalTriggerPrimitiveSample > &out, std::vector< EcalTriggerPrimitiveSample > &outTcc)
 
void setParameters (uint32_t towid, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGTowerStatus *ecaltpgbadTT, const EcalTPGSpike *ecaltpgSpike, const EcalTPGTPMode *ecaltpgTPMode)
 
virtual ~EcalFenixTcpFormatEB ()
 

Private Attributes

const uint16_t * badTTStatus_
 
unsigned int binOfMax_
 
bool debug_
 
const EcalTPGTPModeecaltpgTPMode_
 
bool famos_
 
const unsigned int * lut_
 
uint16_t spikeZeroThresh_
 
uint16_t status_
 
bool tcpFormat_
 

Detailed Description

Definition at line 24 of file EcalFenixTcpFormatEB.h.

Constructor & Destructor Documentation

◆ EcalFenixTcpFormatEB()

EcalFenixTcpFormatEB::EcalFenixTcpFormatEB ( bool  tccFormat,
bool  debug,
bool  famos,
int  binOfMax 
)

Definition at line 11 of file EcalFenixTcpFormatEB.cc.

12  : tcpFormat_(tcpFormat), debug_(debug), famos_(famos), binOfMax_(binOfMax) {
13  status_ = 0;
15 }

References badTTStatus_, and status_.

◆ ~EcalFenixTcpFormatEB()

EcalFenixTcpFormatEB::~EcalFenixTcpFormatEB ( )
virtual

Definition at line 17 of file EcalFenixTcpFormatEB.cc.

17 {}

Member Function Documentation

◆ process() [1/2]

virtual std::vector<int> EcalFenixTcpFormatEB::process ( const std::vector< int > &  ,
const std::vector< int > &   
)
inlinevirtual

Definition at line 28 of file EcalFenixTcpFormatEB.h.

28  {
29  std::vector<int> v;
30  return v;
31  }

References findQualityFiles::v.

Referenced by EcalFenixTcp::process_part2_barrel().

◆ process() [2/2]

void EcalFenixTcpFormatEB::process ( std::vector< int > &  Et_even_sum,
std::vector< int > &  Et_odd_sum,
std::vector< int > &  fgvb,
std::vector< int > &  sfgvb,
int  eTTotShift,
std::vector< EcalTriggerPrimitiveSample > &  out,
std::vector< EcalTriggerPrimitiveSample > &  outTcc 
)

Definition at line 19 of file EcalFenixTcpFormatEB.cc.

25  {
26  // put TP-s in the output
27  // on request also in TcpFormat
28  // for famos version we have to write dummies except for the middle
29 
30  int myEt = 0;
31  if (famos_) {
32  for (unsigned int i = 0; i < out.size(); ++i) {
33  if (i == binOfMax_ - 1) {
34  myEt = Et_even_sum[i] >> eTTotShift;
35  if (myEt > 0x3ff)
36  myEt = 0x3ff;
37 
38  // badTTStatus_ ==0 if the TT works
39  // badTTStatus_ !=0 if there are some problems
40  int lut_out;
41  if (*badTTStatus_ != 0) {
42  lut_out = 0;
43  } else
44  lut_out = (lut_)[myEt];
45 
46  int ttFlag = (lut_out & 0x700) >> 8;
47  myEt = lut_out & 0xff;
48  out[i] = EcalTriggerPrimitiveSample(myEt, fgvb[0], sfgvb[0], ttFlag);
49  } else
51  }
52  } else {
53  for (unsigned int i = 0; i < Et_even_sum.size(); ++i) {
54  int myFgvb = fgvb[i];
55  int mysFgvb = sfgvb[i];
56  bool is_odd_larger = false;
57 
58  // Check if odd sum is larger than even sum, in case flag_EB_odd_even_tcp is used
59  if (Et_odd_sum[i] > Et_even_sum[i]) {
60  is_odd_larger = true;
61  }
62 
64  case 0: //output even sum
65  myEt = Et_even_sum[i];
66  break;
67  case 1: // output larger of odd and even
68  if (Et_odd_sum[i] > Et_even_sum[i]) {
69  myEt = Et_odd_sum[i];
70  } else {
71  myEt = Et_even_sum[i];
72  }
73  break;
74  case 2: // output even+odd
75  myEt = Et_even_sum[i] + Et_odd_sum[i];
76  break;
77  default:
78  // In case of unknown configuration switch to default
79  myEt = Et_even_sum[i];
80  break;
81  }
82 
83  // check TPmode config to decide to output the FGVB or the odd>even flag
84  int infobit1 = myFgvb;
86  infobit1 = is_odd_larger;
87 
88  if (myEt > 0xfff)
89  myEt = 0xfff;
90  myEt >>= eTTotShift;
91  if (myEt > 0x3ff)
92  myEt = 0x3ff;
93 
94  // Spike killer
95  if ((myEt > spikeZeroThresh_) && (mysFgvb == 0)) {
96  myEt = 0;
97  }
98 
99  int lut_out;
100  if (*badTTStatus_ != 0) {
101  lut_out = 0;
102  } else
103  lut_out = (lut_)[myEt];
104 
105  int ttFlag = (lut_out & 0x700) >> 8;
106  if (tcpFormat_) {
107  out2[i] = EcalTriggerPrimitiveSample(((ttFlag & 0x7) << 11) | ((infobit1 & 0x1) << 10) | (myEt & 0x3ff));
108  }
109  myEt = lut_out & 0xff;
110  out[i] = EcalTriggerPrimitiveSample(myEt, infobit1, mysFgvb, ttFlag);
111  }
112  }
113 }

References badTTStatus_, binOfMax_, EcalTPGTPMode::EBFenixTcpInfobit1, EcalTPGTPMode::EBFenixTcpOutput, ecaltpgTPMode_, famos_, mps_fire::i, lut_, MillePedeFileConverter_cfg::out, PointingDoubleMultiSkim_cfg::out2, spikeZeroThresh_, tcpFormat_, and testProducerWithPsetDescEmpty_cfi::x1.

◆ setParameters()

void EcalFenixTcpFormatEB::setParameters ( uint32_t  towid,
const EcalTPGLutGroup ecaltpgLutGroup,
const EcalTPGLutIdMap ecaltpgLut,
const EcalTPGTowerStatus ecaltpgbadTT,
const EcalTPGSpike ecaltpgSpike,
const EcalTPGTPMode ecaltpgTPMode 
)

Definition at line 115 of file EcalFenixTcpFormatEB.cc.

120  {
121  // Get TP zeroing threshold - defaut to 1023 for old data (no record found or
122  // EE)
123  spikeZeroThresh_ = 1023;
124  if (ecaltpgSpike != nullptr) {
125  const EcalTPGSpike::EcalTPGSpikeMap &spikeMap = ecaltpgSpike->getMap();
126  EcalTPGSpike::EcalTPGSpikeMapIterator sit = spikeMap.find(towid);
127  if (sit != spikeMap.end()) {
128  spikeZeroThresh_ = sit->second;
129  }
130  }
131 
132  const EcalTPGGroups::EcalTPGGroupsMap &groupmap = ecaltpgLutGroup->getMap();
133  EcalTPGGroups::EcalTPGGroupsMapItr it = groupmap.find(towid);
134  if (it != groupmap.end()) {
135  uint32_t lutid = (*it).second;
136  const EcalTPGLutIdMap::EcalTPGLutMap &lutmap = ecaltpgLut->getMap();
137  EcalTPGLutIdMap::EcalTPGLutMapItr itl = lutmap.find(lutid);
138  if (itl != lutmap.end()) {
139  lut_ = (*itl).second.getLut();
140  } else
141  edm::LogWarning("EcalTPG") << " could not find EcalTPGLutMap for " << lutid;
142 
143  } else
144  edm::LogWarning("EcalTPG") << " could not find EcalTPGFineGrainTowerEEMap for " << towid;
145 
146  const EcalTPGTowerStatusMap &badTTMap = ecaltpgbadTT->getMap();
147  EcalTPGTowerStatusMapIterator itbadTT = badTTMap.find(towid);
148  if (itbadTT != badTTMap.end()) {
149  badTTStatus_ = &(*itbadTT).second;
150  }
151 
152  ecaltpgTPMode_ = ecaltpgTPMode;
153 }

References badTTStatus_, ecaltpgTPMode_, EcalTPGTowerStatus::getMap(), EcalTPGLutIdMap::getMap(), EcalTPGSpike::getMap(), EcalTPGGroups::getMap(), lut_, and spikeZeroThresh_.

Referenced by EcalFenixTcp::process_part2_barrel().

Member Data Documentation

◆ badTTStatus_

const uint16_t* EcalFenixTcpFormatEB::badTTStatus_
private

Definition at line 48 of file EcalFenixTcpFormatEB.h.

Referenced by EcalFenixTcpFormatEB(), process(), and setParameters().

◆ binOfMax_

unsigned int EcalFenixTcpFormatEB::binOfMax_
private

Definition at line 53 of file EcalFenixTcpFormatEB.h.

Referenced by process().

◆ debug_

bool EcalFenixTcpFormatEB::debug_
private

Definition at line 51 of file EcalFenixTcpFormatEB.h.

◆ ecaltpgTPMode_

const EcalTPGTPMode* EcalFenixTcpFormatEB::ecaltpgTPMode_
private

Definition at line 55 of file EcalFenixTcpFormatEB.h.

Referenced by process(), and setParameters().

◆ famos_

bool EcalFenixTcpFormatEB::famos_
private

Definition at line 52 of file EcalFenixTcpFormatEB.h.

Referenced by process().

◆ lut_

const unsigned int* EcalFenixTcpFormatEB::lut_
private

Definition at line 47 of file EcalFenixTcpFormatEB.h.

Referenced by process(), and setParameters().

◆ spikeZeroThresh_

uint16_t EcalFenixTcpFormatEB::spikeZeroThresh_
private

Definition at line 54 of file EcalFenixTcpFormatEB.h.

Referenced by process(), and setParameters().

◆ status_

uint16_t EcalFenixTcpFormatEB::status_
private

Definition at line 49 of file EcalFenixTcpFormatEB.h.

Referenced by EcalFenixTcpFormatEB().

◆ tcpFormat_

bool EcalFenixTcpFormatEB::tcpFormat_
private

Definition at line 50 of file EcalFenixTcpFormatEB.h.

Referenced by process().

EcalTPGTowerStatus::getMap
const std::map< uint32_t, uint16_t > & getMap() const
Definition: EcalTPGTowerStatus.h:15
mps_fire.i
i
Definition: mps_fire.py:428
EcalTPGLutIdMap::EcalTPGLutMap
std::map< uint32_t, EcalTPGLut > EcalTPGLutMap
Definition: EcalTPGLutIdMap.h:12
EcalTPGGroups::EcalTPGGroupsMapItr
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
Definition: EcalTPGGroups.h:20
EcalFenixTcpFormatEB::debug_
bool debug_
Definition: EcalFenixTcpFormatEB.h:51
EcalFenixTcpFormatEB::ecaltpgTPMode_
const EcalTPGTPMode * ecaltpgTPMode_
Definition: EcalFenixTcpFormatEB.h:55
EcalTPGTowerStatusMapIterator
std::map< uint32_t, uint16_t >::const_iterator EcalTPGTowerStatusMapIterator
Definition: EcalTPGTowerStatus.h:25
EcalFenixTcpFormatEB::spikeZeroThresh_
uint16_t spikeZeroThresh_
Definition: EcalFenixTcpFormatEB.h:54
findQualityFiles.v
v
Definition: findQualityFiles.py:179
EcalTPGTPMode::EBFenixTcpOutput
uint16_t EBFenixTcpOutput
Definition: EcalTPGTPMode.h:27
EcalTPGTPMode::EBFenixTcpInfobit1
uint16_t EBFenixTcpInfobit1
Definition: EcalTPGTPMode.h:28
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
EcalTPGSpike::getMap
const std::map< uint32_t, uint16_t > & getMap() const
Definition: EcalTPGSpike.h:18
debug
#define debug
Definition: HDRShower.cc:19
EcalFenixTcpFormatEB::badTTStatus_
const uint16_t * badTTStatus_
Definition: EcalFenixTcpFormatEB.h:48
EcalTPGTowerStatusMap
std::map< uint32_t, uint16_t > EcalTPGTowerStatusMap
Definition: EcalTPGTowerStatus.h:24
EcalFenixTcpFormatEB::status_
uint16_t status_
Definition: EcalFenixTcpFormatEB.h:49
EcalFenixTcpFormatEB::lut_
const unsigned int * lut_
Definition: EcalFenixTcpFormatEB.h:47
EcalFenixTcpFormatEB::famos_
bool famos_
Definition: EcalFenixTcpFormatEB.h:52
EcalTPGGroups::getMap
const EcalTPGGroupsMap & getMap() const
Definition: EcalTPGGroups.h:25
PointingDoubleMultiSkim_cfg.out2
out2
Definition: PointingDoubleMultiSkim_cfg.py:85
EcalTPGLutIdMap::EcalTPGLutMapItr
std::map< uint32_t, EcalTPGLut >::const_iterator EcalTPGLutMapItr
Definition: EcalTPGLutIdMap.h:13
EcalFenixTcpFormatEB::tcpFormat_
bool tcpFormat_
Definition: EcalFenixTcpFormatEB.h:50
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
EcalFenixTcpFormatEB::binOfMax_
unsigned int binOfMax_
Definition: EcalFenixTcpFormatEB.h:53
EcalTriggerPrimitiveSample
Definition: EcalTriggerPrimitiveSample.h:12
EcalTPGSpike::EcalTPGSpikeMapIterator
std::map< uint32_t, uint16_t >::const_iterator EcalTPGSpikeMapIterator
Definition: EcalTPGSpike.h:12
EcalTPGLutIdMap::getMap
const EcalTPGLutMap & getMap() const
Definition: EcalTPGLutIdMap.h:18
EcalTPGSpike::EcalTPGSpikeMap
std::map< uint32_t, uint16_t > EcalTPGSpikeMap
Definition: EcalTPGSpike.h:11
EcalTPGGroups::EcalTPGGroupsMap
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Definition: EcalTPGGroups.h:19