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
bool getbadStripMissing () const
EcalFenixStripFgvbEEgetFGVB () const
EcalFenixAmplitudeFiltergetFilter () const
EcalFenixStripFormatEBgetFormatterEB () const
EcalFenixStripFormatEEgetFormatterEE () const
EcalFenixLinearizergetLinearizer (int i) const
EcalFenixPeakFindergetPeakFinder () const
void process (const edm::EventSetup &setup, std::vector< EBDataFrame > &samples, int nrXtals, std::vector< int > &out)
void process (const edm::EventSetup &setup, std::vector< EEDataFrame > &samples, int nrXtals, std::vector< int > &out)
template<class T >
void process (const edm::EventSetup &, std::vector< const T > &, int nrxtals, std::vector< int > &out)
template<class T >
void process_part1 (int identif, 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, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE)
void process_part2_endcap (uint32_t stripid, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE, const EcalTPGStripStatus *ecaltpgStripStatus)
void setbadStripMissing (bool flag)
void setPointers (const EcalTPGPedestals *ecaltpPed, const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE, const EcalTPGCrystalStatus *ecaltpgBadX, const EcalTPGStripStatus *ecaltpgStripStatus)
virtual ~EcalFenixStrip ()

Private Attributes

std::vector< int > add_out_
EcalFenixEtStripadder_
EcalFenixAmplitudeFilteramplitude_filter_
bool debug_
const EcalTPGCrystalStatusecaltpgBadX_
const EcalTPGFineGrainStripEEecaltpgFgStripEE_
const EcalTPGSlidingWindowecaltpgSlidW_
const EcalTPGStripStatusecaltpgStripStatus_
const EcalTPGWeightGroupecaltpgWeightGroup_
const EcalTPGWeightIdMapecaltpgWeightMap_
const EcalTPGLinearizationConstecaltpLin_
const EcalTPGPedestalsecaltpPed_
bool famos_
EcalFenixStripFormatEBfenixFormatterEB_
EcalFenixStripFormatEEfenixFormatterEE_
std::vector< int > fgvb_out_
std::vector< int > fgvb_out_temp_
EcalFenixStripFgvbEEfgvbEE_
std::vector< int > filt_out_
std::vector< int > format_out_
bool identif_
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 32 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_, fgvb_out_temp_, fgvbEE_, filt_out_, format_out_, i, lin_out_, linearizer_, nbMaxXtals_, peak_finder_, peak_out_, and findQualityFiles::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);
  fgvb_out_temp_.resize(maxNrSamples);
}
EcalFenixStrip::~EcalFenixStrip ( ) [virtual]

Definition at line 36 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 116 of file EcalFenixStrip.h.

References adder_.

Referenced by process_part1().

{ return  adder_;}
bool EcalFenixStrip::getbadStripMissing ( ) const [inline]

Definition at line 126 of file EcalFenixStrip.h.

References identif_.

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

Definition at line 123 of file EcalFenixStrip.h.

References fgvbEE_.

Referenced by process(), process_part1(), and EcalTrigPrimFunctionalAlgo::run_part2().

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

Definition at line 117 of file EcalFenixStrip.h.

References amplitude_filter_.

Referenced by process_part1().

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

Definition at line 120 of file EcalFenixStrip.h.

References fenixFormatterEB_.

Referenced by process_part2_barrel().

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

Definition at line 121 of file EcalFenixStrip.h.

References fenixFormatterEE_.

Referenced by process_part2_endcap().

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

Definition at line 115 of file EcalFenixStrip.h.

References i, and linearizer_.

Referenced by process_part1().

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

Definition at line 118 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]
void EcalFenixStrip::process ( const edm::EventSetup setup,
std::vector< EBDataFrame > &  samples,
int  nrXtals,
std::vector< int > &  out 
) [inline]

Definition at line 129 of file EcalFenixStrip.h.

References gather_cfg::cout, ecaltpgBadX_, ecaltpgFgStripEE_, ecaltpgSlidW_, ecaltpgWeightGroup_, ecaltpgWeightMap_, ecaltpLin_, ecaltpPed_, format_out_, getFGVB(), EcalFenixStripFgvbEE::getMissedStripFlag(), EcalElectronicsMapping::getTriggerElectronicsId(), identif_, 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
    
    identif_ = getFGVB()->getMissedStripFlag();
    
    process_part1(identif_,samples,nrXtals,stripid,ecaltpPed_,ecaltpLin_,ecaltpgWeightMap_,ecaltpgWeightGroup_,ecaltpgBadX_);//templated part
    process_part2_barrel(stripid,ecaltpgSlidW_,ecaltpgFgStripEE_);//part different for barrel/endcap
    out=format_out_;
  }
template<class T >
void EcalFenixStrip::process_part1 ( int  identif,
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 166 of file EcalFenixStrip.h.

References add_out_, gather_cfg::cout, debug_, ecaltpgFgStripEE_, famos_, fgvb_out_, fgvb_out_temp_, filt_out_, getAdder(), getFGVB(), getFilter(), getLinearizer(), getPeakFinder(), i, lin_out_, peak_out_, EcalFenixLinearizer::process(), EcalFenixAmplitudeFilter::process(), EcalFenixEtStrip::process(), EcalFenixStripFgvbEE::process(), EcalFenixPeakFinder::process(), EcalFenixLinearizer::setParameters(), EcalFenixStripFgvbEE::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;
      }
 
      // Now call the sFGVB - this is common between EB and EE!
      getFGVB()->setParameters(identif, stripid,ecaltpgFgStripEE_);
      getFGVB()->process(lin_out_,fgvb_out_temp_);

      if(debug_)
      {
        std::cout << "output of strip fgvb is a vector of size: " <<std::dec<<fgvb_out_temp_.size()<<std::endl;
        for (unsigned int i =0; i<fgvb_out_temp_.size();i++){
          std::cout << " " << std::dec << (fgvb_out_temp_[i]);
        }
        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_,fgvb_out_temp_,fgvb_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;

          std::cout<< "output of sfgvb after filter is a vector of size: "<<std::dec<<fgvb_out_.size()<<std::endl;
          for (unsigned int ix=0;ix<fgvb_out_.size();ix++){
            std::cout<< "cryst: "<<ix<<"  value : "<<std::dec<<fgvb_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,
const EcalTPGFineGrainStripEE ecaltpgFgStripEE 
)

Definition at line 47 of file EcalFenixStrip.cc.

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

Referenced by process().

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

  // call formatter
  this->getFormatterEB()->setParameters(stripid,ecaltpgSlidW) ; 
  this->getFormatterEB()->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 <<" "<<format_out_[i];
    }    
    std::cout<<std::endl;

  }
  return;

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

Definition at line 70 of file EcalFenixStrip.cc.

References gather_cfg::cout, debug_, fgvb_out_, filt_out_, format_out_, getFormatterEE(), i, peak_out_, EcalFenixStripFormatEE::process(), and EcalFenixStripFormatEE::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,ecaltpgStripStatus) ;

  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::setbadStripMissing ( bool  flag) [inline]

Definition at line 125 of file EcalFenixStrip.h.

References identif_.

{ identif_ = flag; } 
void EcalFenixStrip::setPointers ( const EcalTPGPedestals ecaltpPed,
const EcalTPGLinearizationConst ecaltpLin,
const EcalTPGWeightIdMap ecaltpgWeightMap,
const EcalTPGWeightGroup ecaltpgWeightGroup,
const EcalTPGSlidingWindow ecaltpgSlidW,
const EcalTPGFineGrainStripEE ecaltpgFgStripEE,
const EcalTPGCrystalStatus ecaltpgBadX,
const EcalTPGStripStatus ecaltpgStripStatus 
) [inline]

Definition at line 83 of file EcalFenixStrip.h.

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

Referenced by EcalTrigPrimFunctionalAlgo::setPointers().

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

Member Data Documentation

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

Definition at line 63 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), and process_part1().

Definition at line 57 of file EcalFenixStrip.h.

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

Definition at line 48 of file EcalFenixStrip.h.

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

bool EcalFenixStrip::debug_ [private]

Definition at line 42 of file EcalFenixStrip.h.

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

Definition at line 76 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 75 of file EcalFenixStrip.h.

Referenced by process(), process_part1(), and setPointers().

Definition at line 74 of file EcalFenixStrip.h.

Referenced by process(), and setPointers().

Definition at line 77 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().

bool EcalFenixStrip::famos_ [private]

Definition at line 43 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), and process_part1().

Definition at line 52 of file EcalFenixStrip.h.

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

Definition at line 54 of file EcalFenixStrip.h.

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

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

Definition at line 68 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), and process_part1().

Definition at line 59 of file EcalFenixStrip.h.

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

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

Definition at line 79 of file EcalFenixStrip.h.

Referenced by getbadStripMissing(), process(), and setbadStripMissing().

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

Definition at line 62 of file EcalFenixStrip.h.

Referenced by EcalFenixStrip(), and process_part1().

Definition at line 46 of file EcalFenixStrip.h.

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

Definition at line 44 of file EcalFenixStrip.h.

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

Definition at line 50 of file EcalFenixStrip.h.

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

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

Definition at line 40 of file EcalFenixStrip.h.

Referenced by process().