CMS 3D CMS Logo

Public Member Functions | Private Attributes

EcalUncalibRecHitMaxSampleAlgo< C > Class Template Reference

#include <EcalUncalibRecHitMaxSampleAlgo.h>

Inheritance diagram for EcalUncalibRecHitMaxSampleAlgo< C >:
EcalUncalibRecHitRecAbsAlgo< C >

List of all members.

Public Member Functions

virtual EcalUncalibratedRecHit makeRecHit (const C &dataFrame, const double *pedestals, const double *gainRatios, const EcalWeightSet::EcalWeightMatrix **weights, const EcalWeightSet::EcalChi2WeightMatrix **chi2Matrix)
 compute rechits
virtual ~EcalUncalibRecHitMaxSampleAlgo ()

Private Attributes

int16_t amplitude_
double chi2_
int16_t gainId_
int16_t jitter_
int16_t pedestal_
int16_t sampleAdc_

Detailed Description

template<class C>
class EcalUncalibRecHitMaxSampleAlgo< C >

Amplitude reconstucted by the difference MAX_adc - min_adc jitter is sample number of MAX_adc, pedestal is min_adc

Author:
G. Franzoni, E. Di Marco

Definition at line 15 of file EcalUncalibRecHitMaxSampleAlgo.h.


Constructor & Destructor Documentation

template<class C>
virtual EcalUncalibRecHitMaxSampleAlgo< C >::~EcalUncalibRecHitMaxSampleAlgo ( ) [inline, virtual]

Definition at line 20 of file EcalUncalibRecHitMaxSampleAlgo.h.

{ };

Member Function Documentation

template<class C>
EcalUncalibratedRecHit EcalUncalibRecHitMaxSampleAlgo< C >::makeRecHit ( const C &  dataFrame,
const double *  pedestals,
const double *  gainRatios,
const EcalWeightSet::EcalWeightMatrix **  weights,
const EcalWeightSet::EcalChi2WeightMatrix **  chi2Matrix 
) [virtual]

compute rechits

Implements EcalUncalibRecHitRecAbsAlgo< C >.

Definition at line 34 of file EcalUncalibRecHitMaxSampleAlgo.h.

References flags, EcalUncalibratedRecHit::kSaturated, and min.

Referenced by EcalUncalibRecHitWorkerMaxSample::run().

                                                                                                    {

  amplitude_ = std::numeric_limits<int16_t>::min();
  pedestal_  = 4095;
  jitter_    = -1;
  chi2_      = -1;
  //bool isSaturated = 0;
  uint32_t flags = 0;
  for(int16_t iSample = 0; iSample < C::MAXSAMPLES; iSample++) {
    
    gainId_ = dataFrame.sample(iSample).gainId(); 

    if (gainId_ == 0 )
      {
        flags = EcalUncalibratedRecHit::kSaturated;
      }

    // ampli gain 12
    if ( gainId_ == 1){
      sampleAdc_ = dataFrame.sample(iSample).adc();
    }
      
    else
      {
        if ( gainId_ == 2){       // ampli gain 6
          sampleAdc_ = 200 + (dataFrame.sample(iSample).adc() - 200) * 2 ;
        }
        else  {  // accounts for gainId_==3 or 0 - ampli gain 1 and gain0
          sampleAdc_ = 200 + (dataFrame.sample(iSample).adc() - 200) * 12 ;
        }
      }
    
    if( sampleAdc_ >amplitude_ )          {
      amplitude_ = sampleAdc_;
      jitter_    = iSample;
    }// if statement
    
    if (sampleAdc_<pedestal_) pedestal_ = sampleAdc_;

  }// loop on samples
      
      
  return EcalUncalibratedRecHit( dataFrame.id(), static_cast<double>(amplitude_-pedestal_) , static_cast<double>(pedestal_), static_cast<double>(jitter_ - 5), chi2_, flags );
}

Member Data Documentation

template<class C>
int16_t EcalUncalibRecHitMaxSampleAlgo< C >::amplitude_ [private]

Definition at line 27 of file EcalUncalibRecHitMaxSampleAlgo.h.

template<class C>
double EcalUncalibRecHitMaxSampleAlgo< C >::chi2_ [private]

Definition at line 28 of file EcalUncalibRecHitMaxSampleAlgo.h.

template<class C>
int16_t EcalUncalibRecHitMaxSampleAlgo< C >::gainId_ [private]

Definition at line 27 of file EcalUncalibRecHitMaxSampleAlgo.h.

template<class C>
int16_t EcalUncalibRecHitMaxSampleAlgo< C >::jitter_ [private]

Definition at line 27 of file EcalUncalibRecHitMaxSampleAlgo.h.

template<class C>
int16_t EcalUncalibRecHitMaxSampleAlgo< C >::pedestal_ [private]

Definition at line 27 of file EcalUncalibRecHitMaxSampleAlgo.h.

template<class C>
int16_t EcalUncalibRecHitMaxSampleAlgo< C >::sampleAdc_ [private]

Definition at line 27 of file EcalUncalibRecHitMaxSampleAlgo.h.