CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/SimCalorimetry/EcalTrigPrimAlgos/src/EcalFenixTcpFgvbEE.cc

Go to the documentation of this file.
00001 #include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixTcpFgvbEE.h>
00002 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h"
00003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00004 #include <iostream>
00005 
00006 //---------------------------------------------------------------
00007 EcalFenixTcpFgvbEE::EcalFenixTcpFgvbEE(int maxNrSamples)
00008 {
00009   indexLut_.resize(maxNrSamples); 
00010 }//---------------------------------------------------------------
00011 EcalFenixTcpFgvbEE::~EcalFenixTcpFgvbEE()
00012 {
00013 }
00014 //---------------------------------------------------------------
00015 void EcalFenixTcpFgvbEE::process(std::vector<std::vector<int> > & bypasslin_out, int nStr,int bitMask,std::vector<int> & output)
00016 {
00017   //  std::vector<int> indexLut(output.size());
00018   
00019   for (unsigned int i=0;i<output.size();i++) {
00020     output[i]=0;
00021     indexLut_[i]=0;
00022   }
00023     
00024   for (unsigned int i=0;i<output.size();i++) {
00025     for (int istrip=0;istrip<nStr;istrip++) {
00026       int res = (bypasslin_out[istrip])[i]; 
00027       res = (res >>bitMask) & 1; //res is FGVB at this stage
00028       indexLut_[i]= indexLut_[i] | (res << istrip);
00029     }
00030     indexLut_[i]= indexLut_[i] | (nStr << 5);
00031      
00032     int mask = 1<<indexLut_[i];
00033     output[i]= fgee_lut_ & mask;
00034     if (output[i]>0) output[i]=1;
00035   }
00036   return;
00037 } 
00038 
00039 //------------------------------------------------------------------- 
00040 
00041 void EcalFenixTcpFgvbEE::setParameters(uint32_t towid,const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE)
00042 {
00043 
00044   const  EcalTPGFineGrainTowerEEMap &fgee_map = ecaltpgFineGrainTowerEE -> getMap();
00045 
00046   EcalTPGFineGrainTowerEEMapIterator it=fgee_map.find(towid);
00047   if (it!=fgee_map.end()) fgee_lut_=(*it).second;
00048   else edm::LogWarning("EcalTPG")<<" could not find EcalTPGFineGrainTowerEEMap for "<<towid;
00049 }
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074