CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

EcalFenixTcp Class Reference

class representing the Fenix chip, format strip More...

#include <EcalFenixTcp.h>

List of all members.

Public Member Functions

 EcalFenixTcp (const edm::EventSetup &setup, bool tcpFormat, bool debug, bool famos, int binOfMax, int maxNrSamples, int nbMaxStrips)
EcalFenixEtTotgetAdder () const
EcalFenixBypassLingetBypasslin (int i) const
EcalFenixFgvbEBgetFGVBEB () const
EcalFenixTcpFgvbEEgetFGVBEE () const
EcalFenixTcpFormatgetFormatter () const
EcalFenixMaxof2getMaxOf2 () const
void process (const edm::EventSetup &setup, std::vector< EBDataFrame > &bid, std::vector< std::vector< int > > &tpframetow, int nStr, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, bool isInInnerRings, EcalTrigTowerDetId thisTower)
void process (const edm::EventSetup &setup, std::vector< EEDataFrame > &bid, std::vector< std::vector< int > > &tpframetow, int nStr, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, bool isInInnerRings, EcalTrigTowerDetId thisTower)
void process_part1 (std::vector< std::vector< int > > &tpframetow, int nStr, int bitMask)
void process_part2_barrel (std::vector< std::vector< int > > &, int nStr, const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB, const EcalTPGTowerStatus *ecaltpgBadTT, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, EcalTrigTowerDetId towid)
void process_part2_endcap (std::vector< std::vector< int > > &, int nStr, int bitMask, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE, const EcalTPGTowerStatus *ecaltpgBadTT, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, bool isInInnerRings, EcalTrigTowerDetId towid)
void setPointers (const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE, const EcalTPGTowerStatus *ecaltpgBadTT)
virtual ~EcalFenixTcp ()

Public Attributes

const EcalTPGTowerStatusecaltpgBadTT_
const EcalTPGFineGrainEBGroupecaltpgFgEBGroup_
const EcalTPGFineGrainEBIdMapecaltpgFineGrainEB_
const EcalTPGFineGrainTowerEEecaltpgFineGrainTowerEE_
const EcalTPGLutIdMapecaltpgLut_
const EcalTPGLutGroupecaltpgLutGroup_

Private Attributes

EcalFenixEtTotadder_
std::vector< int > adder_out_
std::vector< EcalFenixBypassLin * > bypasslin_
std::vector< std::vector< int > > bypasslin_out_
bool debug_
std::vector< int > fgvb_out_
EcalFenixFgvbEBfgvbEB_
EcalFenixTcpFgvbEEfgvbEE_
EcalFenixTcpFormatformatter_
EcalFenixMaxof2maxOf2_
std::vector< int > maxOf2_out_
int nbMaxStrips_

Detailed Description

class representing the Fenix chip, format strip

Definition at line 33 of file EcalFenixTcp.h.


Constructor & Destructor Documentation

EcalFenixTcp::EcalFenixTcp ( const edm::EventSetup setup,
bool  tcpFormat,
bool  debug,
bool  famos,
int  binOfMax,
int  maxNrSamples,
int  nbMaxStrips 
)

Definition at line 14 of file EcalFenixTcp.cc.

References adder_, adder_out_, bypasslin_, bypasslin_out_, debug_, fgvb_out_, fgvbEB_, fgvbEE_, formatter_, i, maxOf2_, maxOf2_out_, and nbMaxStrips_.

                                                                                                                                           : debug_(debug),nbMaxStrips_(nbMaxStrips)
 { 
    bypasslin_.resize(nbMaxStrips_);
    for (int i=0;i<nbMaxStrips_;i++) bypasslin_[i] = new EcalFenixBypassLin();
    adder_= new EcalFenixEtTot();
    maxOf2_=new EcalFenixMaxof2(maxNrSamples,nbMaxStrips_);
    formatter_= new EcalFenixTcpFormat(tcpFormat, debug_, famos, binOfMax);
    fgvbEB_= new EcalFenixFgvbEB(maxNrSamples);
    fgvbEE_= new EcalFenixTcpFgvbEE(maxNrSamples);

    // permanent data structures
    bypasslin_out_.resize(nbMaxStrips_);
    std::vector<int> vec(maxNrSamples,0);
    for (int i=0;i<nbMaxStrips_;i++) bypasslin_out_[i]=vec;
    adder_out_.resize(maxNrSamples);
    maxOf2_out_.resize(maxNrSamples);
    fgvb_out_.resize(maxNrSamples);

  }
EcalFenixTcp::~EcalFenixTcp ( ) [virtual]

Definition at line 34 of file EcalFenixTcp.cc.

References adder_, bypasslin_, fgvbEB_, fgvbEE_, formatter_, i, maxOf2_, and nbMaxStrips_.

                              {
    for (int i=0;i<nbMaxStrips_;i++) delete bypasslin_[i];
    delete adder_; 
    delete maxOf2_;
    delete formatter_;
    delete fgvbEB_;
    delete fgvbEE_;
  }

Member Function Documentation

EcalFenixEtTot* EcalFenixTcp::getAdder ( ) const [inline]

Definition at line 111 of file EcalFenixTcp.h.

References adder_.

Referenced by process_part1().

{ return  adder_;}
EcalFenixBypassLin* EcalFenixTcp::getBypasslin ( int  i) const [inline]

Definition at line 110 of file EcalFenixTcp.h.

References bypasslin_, and i.

{return bypasslin_[i];}
EcalFenixFgvbEB* EcalFenixTcp::getFGVBEB ( ) const [inline]

Definition at line 114 of file EcalFenixTcp.h.

References fgvbEB_.

Referenced by process_part2_barrel().

{return fgvbEB_;}
EcalFenixTcpFgvbEE* EcalFenixTcp::getFGVBEE ( ) const [inline]

Definition at line 115 of file EcalFenixTcp.h.

References fgvbEE_.

Referenced by process_part2_endcap().

{return fgvbEE_;}
EcalFenixTcpFormat* EcalFenixTcp::getFormatter ( ) const [inline]

Definition at line 113 of file EcalFenixTcp.h.

References formatter_.

Referenced by process_part2_barrel(), and process_part2_endcap().

{return formatter_;}
EcalFenixMaxof2* EcalFenixTcp::getMaxOf2 ( ) const [inline]

Definition at line 112 of file EcalFenixTcp.h.

References maxOf2_.

Referenced by process_part2_barrel().

{return maxOf2_;}
void EcalFenixTcp::process ( const edm::EventSetup setup,
std::vector< EEDataFrame > &  bid,
std::vector< std::vector< int > > &  tpframetow,
int  nStr,
std::vector< EcalTriggerPrimitiveSample > &  tptow,
std::vector< EcalTriggerPrimitiveSample > &  tptow2,
bool  isInInnerRings,
EcalTrigTowerDetId  thisTower 
)

Definition at line 60 of file EcalFenixTcp.cc.

References ecaltpgBadTT_, ecaltpgFineGrainTowerEE_, ecaltpgLut_, ecaltpgLutGroup_, process_part1(), and process_part2_endcap().

{
  int bitMask=12; // Pascal: endcap has 12 bits as in EB (bug in FENIX!!!!) {was 10 before]
  process_part1(tpframetow,nStr,bitMask);
 
  process_part2_endcap(tpframetow,nStr,bitMask,ecaltpgLutGroup_,ecaltpgLut_,ecaltpgFineGrainTowerEE_,ecaltpgBadTT_,tptow,tptow2,isInInnerRing, towid);
}
void EcalFenixTcp::process ( const edm::EventSetup setup,
std::vector< EBDataFrame > &  bid,
std::vector< std::vector< int > > &  tpframetow,
int  nStr,
std::vector< EcalTriggerPrimitiveSample > &  tptow,
std::vector< EcalTriggerPrimitiveSample > &  tptow2,
bool  isInInnerRings,
EcalTrigTowerDetId  thisTower 
)
void EcalFenixTcp::process_part1 ( std::vector< std::vector< int > > &  tpframetow,
int  nStr,
int  bitMask 
)

Definition at line 73 of file EcalFenixTcp.cc.

References adder_out_, gather_cfg::cout, debug_, getAdder(), i, and EcalFenixEtTot::process().

Referenced by process().

{
//  //call bypasslin
//     for (int istrip=0;istrip<nStr;istrip ++){
//       this->getBypasslin(istrip)->process(tpframetow[istrip],bypasslin_out_[istrip]);
//     }
//     //this is a test
//     if (debug_) {
//       std::cout<<"bypasslinout = "<<std::endl;
//       for (int istrip=0;istrip<nStr;istrip ++){
//      std::vector<int> stripin= bypasslin_out_[istrip];
//      for (unsigned int is=0;is<stripin.size();is++){
//        std::cout<<stripin[is]<<" ";
//      }
//      std::cout<<std::endl;
//       }
//     }

//     //call adder
//     this->getAdder()->process(bypasslin_out_, nStr, bitMask,adder_out_);
     this->getAdder()->process(tpframetow, nStr, bitMask,adder_out_);
    //this is a test:
    if (debug_) {
      std::cout<< "output of adder is a vector of size: "<<adder_out_.size()<<std::endl; 
      std::cout<< "value : "<<std::endl;
      for (unsigned int i =0; i<adder_out_.size();i++){
        std::cout <<" "<<adder_out_[i];
      }    
      std::cout<<std::endl;
    }
    //    return adder_out;
    return;
    
}
void EcalFenixTcp::process_part2_barrel ( std::vector< std::vector< int > > &  bypasslinout,
int  nStr,
const EcalTPGFineGrainEBGroup ecaltpgFgEBGroup,
const EcalTPGLutGroup ecaltpgLutGroup,
const EcalTPGLutIdMap ecaltpgLut,
const EcalTPGFineGrainEBIdMap ecaltpgFineGrainEB,
const EcalTPGTowerStatus ecaltpgBadTT,
std::vector< EcalTriggerPrimitiveSample > &  tptow,
std::vector< EcalTriggerPrimitiveSample > &  tptow2,
EcalTrigTowerDetId  towid 
)

Definition at line 108 of file EcalFenixTcp.cc.

References adder_out_, gather_cfg::cout, debug_, fgvb_out_, getFGVBEB(), getFormatter(), getMaxOf2(), i, maxOf2_out_, EcalFenixMaxof2::process(), EcalFenixFgvbEB::process(), EcalFenixTcpFormat::process(), DetId::rawId(), EcalFenixFgvbEB::setParameters(), and EcalFenixTcpFormat::setParameters().

Referenced by process().

{
  //call maxof2
  //  this->getMaxOf2()->process(bypasslin_out_,nStr,maxOf2_out_);
  this->getMaxOf2()->process(bypasslinout,nStr,maxOf2_out_);
  // this is a test:
  if (debug_) {
    std::cout<< "output of maxof2 is a vector of size: "<<maxOf2_out_.size()<<std::endl; 
    std::cout<< "value : "<<std::endl;
    for (unsigned int i =0; i<maxOf2_out_.size();i++){
      std::cout <<" "<<std::dec<<maxOf2_out_[i];
    }    
    std::cout<<std::endl;
  }
   
  //call fgvb

  this->getFGVBEB()->setParameters(towid.rawId(),ecaltpgFgEBGroup,ecaltpgFineGrainEB);
  this->getFGVBEB()->process(adder_out_,maxOf2_out_,fgvb_out_);
  //this is a test:
  if (debug_) {
    std::cout<< "output of fgvb is a vector of size: "<<fgvb_out_.size()<<std::endl; 
    std::cout<< "value : "<<std::endl;
    for (unsigned int i =0; i<fgvb_out_.size();i++){
      std::cout <<" "<<std::dec<<fgvb_out_[i];
    }    
    std::cout<<std::endl;
  }

  // call formatter
  int eTTotShift=2;
 
  this->getFormatter()->setParameters(towid.rawId(),ecaltpgLutGroup,ecaltpgLut,ecaltpgBadTT);
  this->getFormatter()->process(adder_out_,fgvb_out_,eTTotShift,tcp_out,tcp_outTcc,false);
  //this is a test:
  if (debug_) {
    std::cout<< "output of TCP formatter Barrel is a vector of size: "<<std::dec<<tcp_out.size()<<std::endl; 
    std::cout<< "value : "<<std::endl;
    for (unsigned int i =0; i<tcp_out.size();i++){
      std::cout <<" "<<i<<" "<<std::dec<<tcp_out[i];
    }    
    std::cout<<std::endl;
  }
    
  return;
}
void EcalFenixTcp::process_part2_endcap ( std::vector< std::vector< int > > &  bypasslinout,
int  nStr,
int  bitMask,
const EcalTPGLutGroup ecaltpgLutGroup,
const EcalTPGLutIdMap ecaltpgLut,
const EcalTPGFineGrainTowerEE ecaltpgFineGrainTowerEE,
const EcalTPGTowerStatus ecaltpgBadTT,
std::vector< EcalTriggerPrimitiveSample > &  tptow,
std::vector< EcalTriggerPrimitiveSample > &  tptow2,
bool  isInInnerRings,
EcalTrigTowerDetId  towid 
)

Definition at line 163 of file EcalFenixTcp.cc.

References adder_out_, gather_cfg::cout, debug_, fgvb_out_, fgvbEE_, getFGVBEE(), getFormatter(), i, EcalFenixTcpFgvbEE::process(), EcalFenixTcpFormat::process(), DetId::rawId(), EcalFenixTcpFormat::setParameters(), and EcalFenixTcpFgvbEE::setParameters().

Referenced by process().

{
  //call fgvb
  this->getFGVBEE()->setParameters(towid.rawId(),ecaltpgFineGrainTowerEE);
  //  fgvbEE_->process(bypasslin_out_,nStr,bitMask,fgvb_out_);
  fgvbEE_->process(bypasslinout,nStr,bitMask,fgvb_out_);

  //call formatter
  int eTTotShift=2; // Pascal: endcap has 12 bits as in EB (bug in FENIX!!!!) so shift must be applied to just keep [11:2]

  this->getFormatter()->setParameters(towid.rawId(),ecaltpgLutGroup,ecaltpgLut,ecaltpgbadTT);

  this->getFormatter()->process(adder_out_,fgvb_out_,eTTotShift,tcp_out,tcp_outTcc,isInInnerRings);
  //this is a test:
  if (debug_) {
    std::cout<< "output of TCP formatter(endcap) is a vector of size: "<<std::dec<<tcp_out.size()<<std::endl; 
    std::cout<< "value : "<<std::endl;
    for (unsigned int i =0; i<tcp_out.size();i++){
      std::cout <<" "<<i<<" "<<std::dec<<tcp_out[i]<<std::endl;
    }    
    std::cout<<std::endl;
  }
  return;
}
void EcalFenixTcp::setPointers ( const EcalTPGFineGrainEBGroup ecaltpgFgEBGroup,
const EcalTPGLutGroup ecaltpgLutGroup,
const EcalTPGLutIdMap ecaltpgLut,
const EcalTPGFineGrainEBIdMap ecaltpgFineGrainEB,
const EcalTPGFineGrainTowerEE ecaltpgFineGrainTowerEE,
const EcalTPGTowerStatus ecaltpgBadTT 
) [inline]

Definition at line 56 of file EcalFenixTcp.h.

References ecaltpgBadTT_, ecaltpgFgEBGroup_, ecaltpgFineGrainEB_, ecaltpgFineGrainTowerEE_, ecaltpgLut_, and ecaltpgLutGroup_.

Referenced by EcalTrigPrimFunctionalAlgo::setPointers2().

    {
      ecaltpgFgEBGroup_=ecaltpgFgEBGroup;
      ecaltpgLutGroup_=ecaltpgLutGroup;
      ecaltpgLut_=ecaltpgLut;
      ecaltpgFineGrainEB_=ecaltpgFineGrainEB;
      ecaltpgFineGrainTowerEE_=ecaltpgFineGrainTowerEE;
      ecaltpgBadTT_=ecaltpgBadTT;
   }

Member Data Documentation

Definition at line 42 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), getAdder(), and ~EcalFenixTcp().

std::vector<int> EcalFenixTcp::adder_out_ [private]
std::vector<EcalFenixBypassLin *> EcalFenixTcp::bypasslin_ [private]

Definition at line 41 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), getBypasslin(), and ~EcalFenixTcp().

std::vector<std::vector<int> > EcalFenixTcp::bypasslin_out_ [private]

Definition at line 49 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp().

bool EcalFenixTcp::debug_ [private]

Definition at line 122 of file EcalFenixTcp.h.

Referenced by process(), and setPointers().

Definition at line 117 of file EcalFenixTcp.h.

Referenced by process(), and setPointers().

Definition at line 120 of file EcalFenixTcp.h.

Referenced by process(), and setPointers().

Definition at line 121 of file EcalFenixTcp.h.

Referenced by process(), and setPointers().

Definition at line 119 of file EcalFenixTcp.h.

Referenced by process(), and setPointers().

Definition at line 118 of file EcalFenixTcp.h.

Referenced by process(), and setPointers().

std::vector<int> EcalFenixTcp::fgvb_out_ [private]

Definition at line 52 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), process_part2_barrel(), and process_part2_endcap().

Definition at line 43 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), getFGVBEB(), and ~EcalFenixTcp().

Definition at line 44 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), getFGVBEE(), process_part2_endcap(), and ~EcalFenixTcp().

Definition at line 46 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), getFormatter(), and ~EcalFenixTcp().

Definition at line 40 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), getMaxOf2(), and ~EcalFenixTcp().

std::vector<int> EcalFenixTcp::maxOf2_out_ [private]

Definition at line 51 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), and process_part2_barrel().

Definition at line 38 of file EcalFenixTcp.h.

Referenced by EcalFenixTcp(), and ~EcalFenixTcp().