CMS 3D CMS Logo

EcalFenixStripFgvbEE.cc
Go to the documentation of this file.
5 #include <iostream>
6 
8  identif_ = 0;
9  flagBadStripMiss_ = false;
10 }
11 
13 
14 void EcalFenixStripFgvbEE::process(std::vector<std::vector<int>> &linout, std::vector<int> &output) {
15  std::vector<int> indexLut(output.size());
16 
17  for (unsigned int i = 0; i < output.size(); i++) {
18  output[i] = 0;
19  indexLut[i] = 0;
20  for (unsigned int ixtal = 0; ixtal < linout.size(); ixtal++) {
21  int adc = linout[ixtal][i];
22  int res = (((adc & 0xffff) > threshold_fg_) || ((adc & 0x30000) != 0x0)) ? 1 : 0;
23  indexLut[i] = indexLut[i] | (res << ixtal);
24  }
25  int mask = 1 << (indexLut[i]);
26  output[i] = ((lut_fg_ & mask) == 0x0) ? 0 : 1;
27  if (i > 0)
28  output[i - 1] = output[i]; // Delay one clock
29  }
30  return;
31 }
32 
33 void EcalFenixStripFgvbEE::setParameters(int identif, uint32_t id, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE) {
34  const EcalTPGFineGrainStripEEMap &fgmap = ecaltpgFgStripEE->getMap();
35  EcalTPGFineGrainStripEEMapIterator it = fgmap.find(id);
36  if (it != fgmap.end()) {
37  threshold_fg_ = it->second.threshold;
38  lut_fg_ = it->second.lut;
39  } else {
40  if (identif == false) {
41  edm::LogWarning("EcalTPG") << " could not find EcalTPGFineGrainStripEEMap entry for at least "
42  "one stripId";
43  flagBadStripMiss_ = true;
44  }
45 
46  // Use the FENIX power-up values
47  threshold_fg_ = 65535;
48  lut_fg_ = 0x0;
49  }
50 }
EcalTPGFineGrainStripEEMapIterator
std::map< uint32_t, EcalTPGFineGrainStripEE::Item >::const_iterator EcalTPGFineGrainStripEEMapIterator
Definition: EcalTPGFineGrainStripEE.h:31
EcalFenixStripFgvbEE::threshold_fg_
int threshold_fg_
Definition: EcalFenixStripFgvbEE.h:23
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
EcalFenixStripFgvbEE.h
EcalFenixStripFgvbEE::process
void process(std::vector< std::vector< int >> &lin_out, std::vector< int > &output)
Definition: EcalFenixStripFgvbEE.cc:14
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
EcalTPGFineGrainStripEE
Definition: EcalTPGFineGrainStripEE.h:9
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
EcalTPGFineGrainStripEE.h
EcalFenixStripFgvbEE::setParameters
void setParameters(int identif, uint32_t id, const EcalTPGFineGrainStripEE *)
Definition: EcalFenixStripFgvbEE.cc:33
EcalFenixStripFgvbEE::~EcalFenixStripFgvbEE
virtual ~EcalFenixStripFgvbEE()
Definition: EcalFenixStripFgvbEE.cc:12
EcalTPGFineGrainStripEE::getMap
const std::map< uint32_t, Item > & getMap() const
Definition: EcalTPGFineGrainStripEE.h:21
EcalFenixStripFgvbEE::lut_fg_
int lut_fg_
Definition: EcalFenixStripFgvbEE.h:24
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
EcalTPGFineGrainStripEEMap
std::map< uint32_t, EcalTPGFineGrainStripEE::Item > EcalTPGFineGrainStripEEMap
Definition: EcalTPGFineGrainStripEE.h:30
res
Definition: Electron.h:6
EcalFenixStripFgvbEE::flagBadStripMiss_
bool flagBadStripMiss_
Definition: EcalFenixStripFgvbEE.h:26
EEDataFrame.h
EcalFenixStripFgvbEE::EcalFenixStripFgvbEE
EcalFenixStripFgvbEE()
Definition: EcalFenixStripFgvbEE.cc:7
EcalFenixStripFgvbEE::identif_
int identif_
Definition: EcalFenixStripFgvbEE.h:25