CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalFenixStrip Class Reference

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

#include <EcalFenixStrip.h>

List of all members.

Public Member Functions

 EcalFenixStrip (const edm::EventSetup &setup, const EcalElectronicsMapping *theMapping, bool debug, bool famos, int maxNrSamples, int nbMaxXtals)
EcalFenixEtStripgetAdder () const
EcalFenixStripFgvbEEgetFGVB () const
EcalFenixAmplitudeFiltergetFilter () const
EcalFenixStripFormatEBgetFormatterEB () const
EcalFenixStripFormatEEgetFormatterEE () const
EcalFenixLinearizergetLinearizer (int i) const
EcalFenixPeakFindergetPeakFinder () const
template<class T >
void process (const edm::EventSetup &, std::vector< const T > &, int nrxtals, std::vector< int > &out)
void process (const edm::EventSetup &setup, std::vector< EEDataFrame > &samples, int nrXtals, std::vector< int > &out)
void process (const edm::EventSetup &setup, std::vector< EBDataFrame > &samples, int nrXtals, std::vector< int > &out)
template<class T >
void process_part1 (std::vector< T > &df, int nrXtals, uint32_t stripid, const EcalTPGPedestals *ecaltpPed, const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup, const EcalTPGCrystalStatus *ecaltpBadX)
void process_part2_barrel (uint32_t stripid, const EcalTPGSlidingWindow *ecaltpgSlidW)
void process_part2_endcap (uint32_t stripid, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE)
void setPointers (const EcalTPGPedestals *ecaltpPed, const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE, const EcalTPGCrystalStatus *ecaltpgBadX)
virtual ~EcalFenixStrip ()

Private Attributes

std::vector< int > add_out_
EcalFenixEtStripadder_
EcalFenixAmplitudeFilteramplitude_filter_
bool debug_
const EcalTPGCrystalStatusecaltpgBadX_
const EcalTPGFineGrainStripEEecaltpgFgStripEE_
const EcalTPGSlidingWindowecaltpgSlidW_
const EcalTPGWeightGroupecaltpgWeightGroup_
const EcalTPGWeightIdMapecaltpgWeightMap_
const EcalTPGLinearizationConstecaltpLin_
const EcalTPGPedestalsecaltpPed_
bool famos_
EcalFenixStripFormatEBfenixFormatterEB_
EcalFenixStripFormatEEfenixFormatterEE_
std::vector< int > fgvb_out_
EcalFenixStripFgvbEEfgvbEE_
std::vector< int > filt_out_
std::vector< int > format_out_
std::vector< std::vector< int > > lin_out_
std::vector
< EcalFenixLinearizer * > 
linearizer_
int nbMaxXtals_
EcalFenixPeakFinderpeak_finder_
std::vector< int > peak_out_
const EcalElectronicsMappingtheMapping_

Detailed Description

class representing the Fenix chip, format strip

Definition at line 31 of file EcalFenixStrip.h.


Constructor & Destructor Documentation

EcalFenixStrip::EcalFenixStrip ( const edm::EventSetup setup,
const EcalElectronicsMapping theMapping,
bool  debug,
bool  famos,
int  maxNrSamples,
int  nbMaxXtals 
)

Definition at line 11 of file EcalFenixStrip.cc.

References add_out_, adder_, amplitude_filter_, famos_, fenixFormatterEB_, fenixFormatterEE_, fgvb_out_, fgvbEE_, filt_out_, format_out_, i, lin_out_, linearizer_, nbMaxXtals_, peak_finder_, peak_out_, and v.

                                                                                                                                                           : theMapping_(theMapping), debug_(debug), famos_(famos), nbMaxXtals_(nbMaxXtals)
{ 
  linearizer_.resize(nbMaxXtals_);
  for (int i=0;i<nbMaxXtals_;i++) linearizer_[i] = new  EcalFenixLinearizer(famos_); 
  adder_ = new  EcalFenixEtStrip();
  amplitude_filter_ = new EcalFenixAmplitudeFilter();
  peak_finder_ = new  EcalFenixPeakFinder();
  fenixFormatterEB_ = new EcalFenixStripFormatEB();
  fenixFormatterEE_ = new EcalFenixStripFormatEE();
  fgvbEE_ = new EcalFenixStripFgvbEE();

  // prepare data storage for all events
  std::vector <int> v;
  v.resize(maxNrSamples);
  lin_out_.resize(nbMaxXtals_);  
  for (int i=0;i<5;i++) lin_out_[i]=v;
  add_out_.resize(maxNrSamples);
  filt_out_.resize(maxNrSamples);
  peak_out_.resize(maxNrSamples);
  format_out_.resize(maxNrSamples);
  fgvb_out_.resize(maxNrSamples);
}
EcalFenixStrip::~EcalFenixStrip ( ) [virtual]

Definition at line 35 of file EcalFenixStrip.cc.

References adder_, amplitude_filter_, fenixFormatterEB_, fenixFormatterEE_, fgvbEE_, i, linearizer_, nbMaxXtals_, and peak_finder_.

                                {
  for (int i=0;i<nbMaxXtals_;i++) delete linearizer_[i]; 
  delete adder_; 
  delete amplitude_filter_; 
  delete peak_finder_;
  delete fenixFormatterEB_;
  delete fenixFormatterEE_;
  delete fgvbEE_;
}

Member Function Documentation

EcalFenixEtStrip* EcalFenixStrip::getAdder ( ) const [inline]

Definition at line 109 of file EcalFenixStrip.h.

References adder_.

Referenced by process_part1().

{ return  adder_;}
EcalFenixStripFgvbEE* EcalFenixStrip::getFGVB ( ) const [inline]

Definition at line 116 of file EcalFenixStrip.h.

References fgvbEE_.

Referenced by process_part2_endcap().

{ return fgvbEE_;}
EcalFenixAmplitudeFilter* EcalFenixStrip::getFilter ( ) const [inline]

Definition at line 110 of file EcalFenixStrip.h.

References amplitude_filter_.

Referenced by process_part1().

{ return amplitude_filter_;}
EcalFenixStripFormatEB* EcalFenixStrip::getFormatterEB ( ) const [inline]

Definition at line 113 of file EcalFenixStrip.h.

References fenixFormatterEB_.

Referenced by process_part2_barrel().

{ return fenixFormatterEB_;}
EcalFenixStripFormatEE* EcalFenixStrip::getFormatterEE ( ) const [inline]

Definition at line 114 of file EcalFenixStrip.h.

References fenixFormatterEE_.

Referenced by process_part2_endcap().

{ return fenixFormatterEE_;}
EcalFenixLinearizer* EcalFenixStrip::getLinearizer ( int  i) const [inline]

Definition at line 108 of file EcalFenixStrip.h.

References i, and linearizer_.

Referenced by process_part1().

{ return linearizer_[i];}
EcalFenixPeakFinder* EcalFenixStrip::getPeakFinder ( ) const [inline]

Definition at line 111 of file EcalFenixStrip.h.

References peak_finder_.

Referenced by process_part1().

{ return peak_finder_;}
template<class T >
void EcalFenixStrip::process ( const edm::EventSetup ,
std::vector< const T > &  ,
int  nrxtals,
std::vector< int > &  out 
)
void EcalFenixStrip::process ( const edm::EventSetup setup,
std::vector< EEDataFrame > &  samples,
int  nrXtals,
std::vector< int > &  out 
) [inline]

Definition at line 134 of file EcalFenixStrip.h.

References gather_cfg::cout, ecaltpgBadX_, ecaltpgFgStripEE_, ecaltpgSlidW_, ecaltpgWeightGroup_, ecaltpgWeightMap_, ecaltpLin_, ecaltpPed_, format_out_, EcalElectronicsMapping::getTriggerElectronicsId(), process_part1(), process_part2_endcap(), EcalTriggerElectronicsId::rawId(), and theMapping_.

                                                                                                              {

// now call processing
   if (samples.size()==0) {
     std::cout<<" Warning: 0 size vector found in EcalFenixStripProcess!!!!!"<<std::endl;
     return;
   }
   const EcalTriggerElectronicsId elId = theMapping_->getTriggerElectronicsId(samples[0].id());
   uint32_t stripid=elId.rawId() & 0xfffffff8;   //from Pascal
   process_part1(samples,nrXtals,stripid,ecaltpPed_,ecaltpLin_,ecaltpgWeightMap_,ecaltpgWeightGroup_,ecaltpgBadX_); //templated part
   process_part2_endcap(stripid,ecaltpgSlidW_,ecaltpgFgStripEE_);
   out=format_out_; //FIXME: timing
   return;
 }
void EcalFenixStrip::process ( const edm::EventSetup setup,
std::vector< EBDataFrame > &  samples,
int  nrXtals,
std::vector< int > &  out 
) [inline]

Definition at line 119 of file EcalFenixStrip.h.

References gather_cfg::cout, ecaltpgBadX_, ecaltpgSlidW_, ecaltpgWeightGroup_, ecaltpgWeightMap_, ecaltpLin_, ecaltpPed_, format_out_, EcalElectronicsMapping::getTriggerElectronicsId(), process_part1(), process_part2_barrel(), EcalTriggerElectronicsId::rawId(), and theMapping_.

                                                                                                            {

    // now call processing
    if (samples.size()==0) {
      std::cout<<" Warning: 0 size vector found in EcalFenixStripProcess!!!!!"<<std::endl;
      return;

    }
    const EcalTriggerElectronicsId elId = theMapping_->getTriggerElectronicsId(samples[0].id());
    uint32_t stripid=elId.rawId() & 0xfffffff8;   //from Pascal
    process_part1(samples,nrXtals,stripid,ecaltpPed_,ecaltpLin_,ecaltpgWeightMap_,ecaltpgWeightGroup_,ecaltpgBadX_);//templated part
    process_part2_barrel(stripid,ecaltpgSlidW_);//part different for barrel/endcap
    out=format_out_;
  }
template<class T >
void EcalFenixStrip::process_part1 ( std::vector< T > &  df,
int  nrXtals,
uint32_t  stripid,
const EcalTPGPedestals ecaltpPed,
const EcalTPGLinearizationConst ecaltpLin,
const EcalTPGWeightIdMap ecaltpgWeightMap,
const EcalTPGWeightGroup ecaltpgWeightGroup,
const EcalTPGCrystalStatus ecaltpBadX 
) [inline]

Definition at line 150 of file EcalFenixStrip.h.

References add_out_, gather_cfg::cout, debug_, famos_, filt_out_, getAdder(), getFilter(), getLinearizer(), getPeakFinder(), i, lin_out_, peak_out_, EcalFenixLinearizer::process(), EcalFenixAmplitudeFilter::process(), EcalFenixEtStrip::process(), EcalFenixPeakFinder::process(), EcalFenixLinearizer::setParameters(), and EcalFenixAmplitudeFilter::setParameters().

Referenced by process().

   {
  
      if(debug_)  std::cout<<"\n\nEcalFenixStrip input is a vector of size: "<<nrXtals<< std::endl;

      //loop over crystals
      for (int cryst=0;cryst<nrXtals;cryst++) {
        if(debug_){
          std::cout<<std::endl;
          std::cout <<"cryst= "<<cryst<<" EBDataFrame/EEDataFrame is: "<<std::endl; 
          for ( int i = 0; i<df[cryst].size();i++){
            std::cout <<" "<<std::dec<<df[cryst][i].adc();
          }
          std::cout<<std::endl;
        }
        // call linearizer
        this->getLinearizer(cryst)->setParameters(df[cryst].id().rawId(),ecaltpPed,ecaltpLin,ecaltpBadX) ; 
        this->getLinearizer(cryst)->process(df[cryst],lin_out_[cryst]);
      }

      if(debug_){
        std::cout<< "output of linearizer is a vector of size: "
              <<std::dec<<lin_out_.size()<<" of which used "<<nrXtals<<std::endl; 
        for (int ix=0;ix<nrXtals;ix++){
          std::cout<< "cryst: "<<ix<<"  value : "<<std::dec<<std::endl;
          std::cout<<" lin_out[ix].size()= "<<std::dec<<lin_out_[ix].size()<<std::endl;
          for (unsigned int i =0; i<lin_out_[ix].size();i++){
            std::cout <<" "<<std::dec<<(lin_out_[ix])[i];
          }
          std::cout<<std::endl;
        }
    
        std::cout<<std::endl;
      }
  
      // call adder
      this->getAdder()->process(lin_out_,nrXtals,add_out_);  //add_out is of size SIZEMAX=maxNrSamples
 
      if(debug_){
        std::cout<< "output of adder is a vector of size: "<<std::dec<<add_out_.size()<<std::endl; 
        for (unsigned int ix=0;ix<add_out_.size();ix++){
          std::cout<< "cryst: "<<ix<<"  value : "<<std::dec<<add_out_[ix]<<std::endl;
        }
        std::cout<<std::endl;
      }
 

      if (famos_) {
        filt_out_[0]= add_out_[0];
        peak_out_[0]= add_out_[0];
        return;
      }else {
        // call amplitudefilter
        this->getFilter()->setParameters(stripid,ecaltpgWeightMap,ecaltpgWeightGroup); 
        this->getFilter()->process(add_out_,filt_out_); 

        if(debug_){
          std::cout<< "output of filter is a vector of size: "<<std::dec<<filt_out_.size()<<std::endl; 
          for (unsigned int ix=0;ix<filt_out_.size();ix++){
            std::cout<< "cryst: "<<ix<<"  value : "<<std::dec<<filt_out_[ix]<<std::endl;
          }
          std::cout<<std::endl;
        }

        // call peakfinder
        this->getPeakFinder()->process(filt_out_,peak_out_);
        if(debug_){
          std::cout<< "output of peakfinder is a vector of size: "<<peak_out_.size()<<std::endl; 
          for (unsigned int ix=0;ix<peak_out_.size();ix++){
            std::cout<< "cryst: "<<ix<<"  value : "<<peak_out_[ix]<<std::endl;
          }
          std::cout<<std::endl;
        }
        return;
      }
   }
void EcalFenixStrip::process_part2_barrel ( uint32_t  stripid,
const EcalTPGSlidingWindow ecaltpgSlidW 
)

Definition at line 46 of file EcalFenixStrip.cc.

References gather_cfg::cout, debug_, filt_out_, format_out_, getFormatterEB(), i, peak_out_, EcalFenixStripFormatEB::process(), and EcalFenixStripFormatEB::setParameters().

Referenced by process().

                                                                                                    {
  
  // call formatter
  this->getFormatterEB()->setParameters(stripid,ecaltpgSlidW) ; 
  this->getFormatterEB()->process(peak_out_,filt_out_,format_out_);     
  //this is a test:
  if (debug_) {
    std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl; 
    std::cout<< "value : "<<std::endl;
    for (unsigned int i =0; i<format_out_.size();i++){
      std::cout <<" "<<format_out_[i];
    }    
    std::cout<<std::endl;

  }
  return;

}
void EcalFenixStrip::process_part2_endcap ( uint32_t  stripid,
const EcalTPGSlidingWindow ecaltpgSlidW,
const EcalTPGFineGrainStripEE ecaltpgFgStripEE 
)

Definition at line 65 of file EcalFenixStrip.cc.

References gather_cfg::cout, debug_, fgvb_out_, filt_out_, format_out_, getFGVB(), getFormatterEE(), i, lin_out_, peak_out_, EcalFenixStripFormatEE::process(), EcalFenixStripFgvbEE::process(), EcalFenixStripFormatEE::setParameters(), and EcalFenixStripFgvbEE::setParameters().

Referenced by process().

                                                                                                                                                      {
   
  // call  Fgvb
  this->getFGVB()->setParameters(stripid,ecaltpgFgStripEE); 
  this->getFGVB()->process(lin_out_,fgvb_out_);

  // call formatter
  this->getFormatterEE()->setParameters(stripid,ecaltpgSlidW) ;

  this->getFormatterEE()->process(fgvb_out_,peak_out_,filt_out_,format_out_);
     
  //this is a test:
   if (debug_) {
     std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl; 
      std::cout<< "value : "<<std::endl;
      for (unsigned int i =0; i<format_out_.size();i++){
        std::cout <<" "<<std::dec<<format_out_[i];
      }    
     std::cout<<std::endl;
   }

   return;
}
void EcalFenixStrip::setPointers ( const EcalTPGPedestals ecaltpPed,
const EcalTPGLinearizationConst ecaltpLin,
const EcalTPGWeightIdMap ecaltpgWeightMap,
const EcalTPGWeightGroup ecaltpgWeightGroup,
const EcalTPGSlidingWindow ecaltpgSlidW,
const EcalTPGFineGrainStripEE ecaltpgFgStripEE,
const EcalTPGCrystalStatus ecaltpgBadX 
) [inline]

Definition at line 78 of file EcalFenixStrip.h.

References ecaltpgBadX_, ecaltpgFgStripEE_, ecaltpgSlidW_, ecaltpgWeightGroup_, ecaltpgWeightMap_, ecaltpLin_, and ecaltpPed_.

Referenced by EcalTrigPrimFunctionalAlgo::setPointers().

    {
      ecaltpPed_=ecaltpPed;
      ecaltpLin_=ecaltpLin;
      ecaltpgWeightMap_=ecaltpgWeightMap;
      ecaltpgWeightGroup_= ecaltpgWeightGroup;
      ecaltpgSlidW_=ecaltpgSlidW;
      ecaltpgFgStripEE_=ecaltpgFgStripEE;
      ecaltpgBadX_=ecaltpgBadX;
    }

Member Data Documentation

std::vector<int> EcalFenixStrip::add_out_ [private]

Definition at line 62 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), and process_part1().

Definition at line 56 of file EcalFenixStrip.h.

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

Definition at line 47 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), getFilter(), and ~EcalFenixStrip().

bool EcalFenixStrip::debug_ [private]

Definition at line 41 of file EcalFenixStrip.h.

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

Definition at line 74 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 73 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 72 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 71 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 70 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 69 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 68 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

bool EcalFenixStrip::famos_ [private]

Definition at line 42 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), and process_part1().

Definition at line 51 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), getFormatterEB(), and ~EcalFenixStrip().

Definition at line 53 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), getFormatterEE(), and ~EcalFenixStrip().

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

Definition at line 66 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), and process_part2_endcap().

Definition at line 58 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), getFGVB(), and ~EcalFenixStrip().

std::vector<int> EcalFenixStrip::filt_out_ [private]
std::vector<int> EcalFenixStrip::format_out_ [private]
std::vector<std::vector<int> > EcalFenixStrip::lin_out_ [private]

Definition at line 61 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), process_part1(), and process_part2_endcap().

Definition at line 45 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), getLinearizer(), and ~EcalFenixStrip().

Definition at line 43 of file EcalFenixStrip.h.

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

Definition at line 49 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), getPeakFinder(), and ~EcalFenixStrip().

std::vector<int> EcalFenixStrip::peak_out_ [private]

Definition at line 39 of file EcalFenixStrip.h.

Referenced by process().