CMS 3D CMS Logo

EcalFenixFgvbEB.cc
Go to the documentation of this file.
5 
7  add_out_8_.resize(maxNrSamples);
8 }
9 
11 
12 void EcalFenixFgvbEB::process(std::vector<int> &add_out,
13  std::vector<int> &maxof2_out,
14  std::vector<int> &output) {
15 
16  int Elow, Ehigh, Tlow, Thigh, lut;
17  int ERatLow, ERatHigh;
18  // std::vector<int> add_out_8(add_out.size());
19  int COMP3, COMP2, COMP1, COMP0;
20 
21  // Elow = (*params_)[1024];
22  // Ehigh = (*params_)[1025];
23  // Tlow = (*params_)[1026];
24  // Thigh = (*params_)[1027];
25  // lut = (*params_)[1028];
26 
27  Elow = ETlow_;
28  Ehigh = EThigh_;
29  Tlow = Ratlow_;
30  Thigh = Rathigh_;
31  lut = lut_;
32 
33  if (Tlow > 127)
34  Tlow = Tlow - 128;
35  if (Thigh > 127)
36  Thigh = Thigh - 128;
37 
38  for (unsigned int i = 0; i < add_out.size(); i++) {
39 
40  ERatLow = add_out[i] * Tlow >> 7;
41  if (ERatLow > 0xFFF)
42  ERatLow = 0xFFF;
43  ERatHigh = add_out[i] * Thigh >> 7;
44  if (ERatHigh > 0xFFF)
45  ERatHigh = 0xFFF;
46  if (add_out[i] > 0XFF)
47  add_out_8_[i] = 0xFF;
48  else
49  add_out_8_[i] = add_out[i];
50 
51  if (maxof2_out[i] >= ERatLow)
52  COMP3 = 1;
53  else
54  COMP3 = 0;
55  if (maxof2_out[i] >= ERatHigh)
56  COMP2 = 1;
57  else
58  COMP2 = 0;
59  if (add_out_8_[i] >= Elow)
60  COMP1 = 1;
61  else
62  COMP1 = 0;
63  if (add_out_8_[i] >= Ehigh)
64  COMP0 = 1;
65  else
66  COMP0 = 0;
67 
68  int ilut = (COMP3 << 3) + (COMP2 << 2) + (COMP1 << 1) + COMP0;
69  int mask = 1 << (ilut);
70  output[i] = (lut) & (mask);
71  if (output[i] > 0)
72  output[i] = 1;
73  }
74  return;
75 }
76 
78  uint32_t towid, const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup,
79  const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB) {
80 
81  const EcalTPGGroups::EcalTPGGroupsMap &groupmap = ecaltpgFgEBGroup->getMap();
82  EcalTPGGroups::EcalTPGGroupsMapItr it = groupmap.find(towid);
83  if (it != groupmap.end()) {
84  // uint32_t fgid =(*it).second;
85  // const EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMap fgmap =
86  // ecaltpgFineGrainEB -> getMap();
87  // EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMapItr itfg =
88  // fgmap.find(fgid);
89  // (*itfg).second.getValues( ETlow_, EThigh_, Ratlow_, Rathigh_,
90  // lut_);
92  (ecaltpgFineGrainEB->getMap()).find((*it).second);
93  (*itfg).second.getValues(ETlow_, EThigh_, Ratlow_, Rathigh_, lut_);
94  } else
95  edm::LogWarning("EcalTPG")
96  << " could not find EcalTPGGroupsMap entry for " << towid;
97 }
const EcalTPGGroupsMap & getMap() const
Definition: EcalTPGGroups.h:28
void setParameters(uint32_t towid, const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB)
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
Definition: EcalTPGGroups.h:23
void process(std::vector< int > &add_out, std::vector< int > &maxof2_out, std::vector< int > &output)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
virtual ~EcalFenixFgvbEB()
const EcalTPGFineGrainEBMap & getMap() const
std::vector< int > add_out_8_
EcalFenixFgvbEB(int maxNrSamples)
std::map< uint32_t, EcalTPGFineGrainConstEB >::const_iterator EcalTPGFineGrainEBMapItr
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Definition: EcalTPGGroups.h:22