CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalFenixFgvbEB Class Reference

calculation of Fgvb for Fenix Tcp, format barrel calculates fgvb for the barrel More...

#include <EcalFenixFgvbEB.h>

List of all members.

Public Member Functions

 EcalFenixFgvbEB (int maxNrSamples)
void process (std::vector< int > &add_out, std::vector< int > &maxof2_out, std::vector< int > &output)
void setParameters (uint32_t towid, const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB)
virtual ~EcalFenixFgvbEB ()

Private Attributes

std::vector< int > add_out_8_
uint32_t EThigh_
uint32_t ETlow_
uint32_t lut_
uint32_t Rathigh_
uint32_t Ratlow_

Detailed Description

calculation of Fgvb for Fenix Tcp, format barrel calculates fgvb for the barrel

input: 2X12 bits ( 12 bits Ettot + 12 bits maxof2) output: 1 bit

makes comparisons between maxof2 and 2 fractions of Ettot and uses this comparison to decide ---> needs to get some values from outside

Definition at line 22 of file EcalFenixFgvbEB.h.


Constructor & Destructor Documentation

EcalFenixFgvbEB::EcalFenixFgvbEB ( int  maxNrSamples)

Definition at line 6 of file EcalFenixFgvbEB.cc.

References add_out_8_.

 {
   add_out_8_.resize(maxNrSamples); 
}
EcalFenixFgvbEB::~EcalFenixFgvbEB ( ) [virtual]

Definition at line 11 of file EcalFenixFgvbEB.cc.

                                 {
}

Member Function Documentation

void EcalFenixFgvbEB::process ( std::vector< int > &  add_out,
std::vector< int > &  maxof2_out,
std::vector< int > &  output 
)

Definition at line 14 of file EcalFenixFgvbEB.cc.

References add_out_8_, EThigh_, ETlow_, i, lut_, Rathigh_, and Ratlow_.

Referenced by EcalFenixTcp::process_part2_barrel().

                                                                                                          {

    int Elow, Ehigh, Tlow, Thigh, lut;
    int ERatLow,ERatHigh;
    //    std::vector<int> add_out_8(add_out.size());
    int COMP3, COMP2, COMP1, COMP0;
   
   //  Elow = (*params_)[1024];
//     Ehigh = (*params_)[1025];
//     Tlow = (*params_)[1026];
//     Thigh = (*params_)[1027];
//     lut = (*params_)[1028];

    Elow = ETlow_;
    Ehigh = EThigh_;
    Tlow = Ratlow_;
    Thigh = Rathigh_;
    lut = lut_;

    
    if (Tlow > 127) Tlow=Tlow-128;
    if (Thigh > 127) Thigh=Thigh-128;
   
    for (unsigned int i =0;i<add_out.size();i++) {
      
      ERatLow=add_out[i]*Tlow>>7;
      if (ERatLow>0xFFF) ERatLow=0xFFF;
      ERatHigh=add_out[i]*Thigh>>7;
      if (ERatHigh>0xFFF) ERatHigh=0xFFF;
      if (add_out[i] >0XFF) add_out_8_[i]=0xFF; else add_out_8_[i]=add_out[i];

      if( maxof2_out[i] >= ERatLow)  COMP3=1; else COMP3=0;
      if( maxof2_out[i] >= ERatHigh) COMP2=1; else COMP2=0;
      if( add_out_8_[i]  >= Elow)     COMP1=1; else COMP1=0;
      if( add_out_8_[i]  >= Ehigh)    COMP0=1; else COMP0=0;

      int ilut= (COMP3<<3) + (COMP2<<2) + (COMP1<<1) + COMP0;
      int mask = 1<<(ilut);
      output[i]= (lut) & (mask);
      if (output[i]>0) output[i]=1;
    }
    return;
  }
void EcalFenixFgvbEB::setParameters ( uint32_t  towid,
const EcalTPGFineGrainEBGroup ecaltpgFgEBGroup,
const EcalTPGFineGrainEBIdMap ecaltpgFineGrainEB 
)

Definition at line 58 of file EcalFenixFgvbEB.cc.

References EThigh_, ETlow_, spr::find(), lut_, Rathigh_, and Ratlow_.

Referenced by EcalFenixTcp::process_part2_barrel().

                                                                                                                                                     {

  const EcalTPGGroups::EcalTPGGroupsMap &groupmap = ecaltpgFgEBGroup -> getMap();
  EcalTPGGroups::EcalTPGGroupsMapItr it= groupmap.find(towid);
  if (it!=groupmap.end()) {
//     uint32_t fgid =(*it).second;
//     const EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMap fgmap = ecaltpgFineGrainEB -> getMap();
//     EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMapItr itfg = fgmap.find(fgid);
//     (*itfg).second.getValues( ETlow_,  EThigh_,  Ratlow_,  Rathigh_, lut_);
     EcalTPGFineGrainEBIdMap::EcalTPGFineGrainEBMapItr itfg = (ecaltpgFineGrainEB -> getMap()).find((*it).second);
     (*itfg).second.getValues( ETlow_,  EThigh_,  Ratlow_,  Rathigh_, lut_);
  }
  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGGroupsMap entry for "<<towid;
 
}

Member Data Documentation

std::vector<int> EcalFenixFgvbEB::add_out_8_ [private]

Definition at line 29 of file EcalFenixFgvbEB.h.

Referenced by EcalFenixFgvbEB(), and process().

uint32_t EcalFenixFgvbEB::EThigh_ [private]

Definition at line 25 of file EcalFenixFgvbEB.h.

Referenced by process(), and setParameters().

uint32_t EcalFenixFgvbEB::ETlow_ [private]

Definition at line 25 of file EcalFenixFgvbEB.h.

Referenced by process(), and setParameters().

uint32_t EcalFenixFgvbEB::lut_ [private]

Definition at line 25 of file EcalFenixFgvbEB.h.

Referenced by process(), and setParameters().

uint32_t EcalFenixFgvbEB::Rathigh_ [private]

Definition at line 25 of file EcalFenixFgvbEB.h.

Referenced by process(), and setParameters().

uint32_t EcalFenixFgvbEB::Ratlow_ [private]

Definition at line 25 of file EcalFenixFgvbEB.h.

Referenced by process(), and setParameters().