CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalFenixFgvbEB.cc
Go to the documentation of this file.
5 
7  {
8  add_out_8_.resize(maxNrSamples);
9 }
10 
12 }
13 
14 void EcalFenixFgvbEB::process( std::vector<int> &add_out, std::vector<int> &maxof2_out, 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 
34  if (Tlow > 127) Tlow=Tlow-128;
35  if (Thigh > 127) Thigh=Thigh-128;
36 
37  for (unsigned int i =0;i<add_out.size();i++) {
38 
39  ERatLow=add_out[i]*Tlow>>7;
40  if (ERatLow>0xFFF) ERatLow=0xFFF;
41  ERatHigh=add_out[i]*Thigh>>7;
42  if (ERatHigh>0xFFF) ERatHigh=0xFFF;
43  if (add_out[i] >0XFF) add_out_8_[i]=0xFF; else add_out_8_[i]=add_out[i];
44 
45  if( maxof2_out[i] >= ERatLow) COMP3=1; else COMP3=0;
46  if( maxof2_out[i] >= ERatHigh) COMP2=1; else COMP2=0;
47  if( add_out_8_[i] >= Elow) COMP1=1; else COMP1=0;
48  if( add_out_8_[i] >= Ehigh) COMP0=1; else COMP0=0;
49 
50  int ilut= (COMP3<<3) + (COMP2<<2) + (COMP1<<1) + COMP0;
51  int mask = 1<<(ilut);
52  output[i]= (lut) & (mask);
53  if (output[i]>0) output[i]=1;
54  }
55  return;
56  }
57 
58 void EcalFenixFgvbEB::setParameters(uint32_t towid,const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup,const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB ){
59 
60  const EcalTPGGroups::EcalTPGGroupsMap &groupmap = ecaltpgFgEBGroup -> getMap();
61  EcalTPGGroups::EcalTPGGroupsMapItr it= groupmap.find(towid);
62  if (it!=groupmap.end()) {
63 // uint32_t fgid =(*it).second;
64 // const EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMap fgmap = ecaltpgFineGrainEB -> getMap();
65 // EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMapItr itfg = fgmap.find(fgid);
66 // (*itfg).second.getValues( ETlow_, EThigh_, Ratlow_, Rathigh_, lut_);
67  EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMapItr itfg = (ecaltpgFineGrainEB -> getMap()).find((*it).second);
68  (*itfg).second.getValues( ETlow_, EThigh_, Ratlow_, Rathigh_, lut_);
69  }
70  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGGroupsMap entry for "<<towid;
71 
72 }
int i
Definition: DBlmapReader.cc:9
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:7
virtual ~EcalFenixFgvbEB()
std::vector< int > add_out_8_
tuple lut
Definition: lumiPlot.py:244
EcalFenixFgvbEB(int maxNrSamples)
std::map< uint32_t, EcalTPGFineGrainConstEB >::const_iterator EcalTPGFineGrainEBMapItr
std::map< uint32_t, uint32_t > EcalTPGGroupsMap
Definition: EcalTPGGroups.h:22