16 int Elow, Ehigh, Tlow, Thigh, lut;
19 int COMP3, COMP2, COMP1, COMP0;
34 if (Tlow > 127) Tlow=Tlow-128;
35 if (Thigh > 127) Thigh=Thigh-128;
37 for (
unsigned int i =0;
i<add_out.size();
i++) {
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;
45 if( maxof2_out[
i] >= ERatLow) COMP3=1;
else COMP3=0;
46 if( maxof2_out[
i] >= ERatHigh) COMP2=1;
else COMP2=0;
50 int ilut= (COMP3<<3) + (COMP2<<2) + (COMP1<<1) + COMP0;
52 output[
i]= (lut) & (mask);
53 if (output[
i]>0) output[
i]=1;
62 if (it!=groupmap.end()) {
70 else edm::LogWarning(
"EcalTPG")<<
" could not find EcalTPGGroupsMap entry for "<<towid;
void setParameters(uint32_t towid, const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB)
std::map< uint32_t, uint32_t >::const_iterator EcalTPGGroupsMapItr
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)
virtual ~EcalFenixFgvbEB()
std::vector< int > add_out_8_
EcalFenixFgvbEB(int maxNrSamples)
std::map< uint32_t, EcalTPGFineGrainConstEB >::const_iterator EcalTPGFineGrainEBMapItr
std::map< uint32_t, uint32_t > EcalTPGGroupsMap