CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Attributes

CaloSamples Class Reference

#include <CaloSamples.h>

List of all members.

Public Member Functions

 CaloSamples ()
 CaloSamples (const DetId &id, int size)
DetId id () const
 get the (generic) id
bool isBlank () const
CaloSamplesoperator*= (double value)
 scale all samples
CaloSamplesoperator+= (double value)
 add a value to all samples
double & operator[] (int i)
 mutable operator to access samples
double operator[] (int i) const
 const operator to access samples
int presamples () const
 access presample information
CaloSamplesscale (double value)
 multiply each item by this value
void setBlank ()
void setDetId (DetId detId)
void setPresamples (int pre)
 set presample information
void setSize (unsigned int size)
int size () const
 get the size

Static Public Attributes

static const int MAXSAMPLES = 10

Private Attributes

double data_ [MAXSAMPLES]
DetId id_
int presamples_
int size_

Detailed Description

Class which represents the charge/voltage measurements of an event/channel with the ADC decoding performed.

Date:
2010/03/26 05:50:23
Revision:
1.4

Definition at line 15 of file CaloSamples.h.


Constructor & Destructor Documentation

CaloSamples::CaloSamples ( )

Definition at line 4 of file CaloSamples.cc.

References setBlank().

: id_(), size_(0), presamples_(0) { setBlank() ; }
CaloSamples::CaloSamples ( const DetId id,
int  size 
) [explicit]

Definition at line 6 of file CaloSamples.cc.

References setBlank().

                                                  :
   id_          ( id   ) , 
   size_        ( size ) , 
   presamples_  ( 0    ) 
{
   setBlank() ;
}

Member Function Documentation

DetId CaloSamples::id ( void  ) const [inline]
bool CaloSamples::isBlank ( ) const

Definition at line 35 of file CaloSamples.cc.

References data_, ExpressReco_HICollisions_FallBack::e, funct::false, i, MAXSAMPLES, and funct::true.

Referenced by CaloHitRespoNew::findSignal().

{
   for( int i ( 0 ) ; i != MAXSAMPLES ; ++i )
   {
      if( 1.e-6 < fabs( data_[i] ) ) return false ;
   }
   return true ;
}
CaloSamples& CaloSamples::operator*= ( double  value) [inline]

scale all samples

Definition at line 38 of file CaloSamples.h.

References scale().

{ return scale(value); }
CaloSamples & CaloSamples::operator+= ( double  value)

add a value to all samples

Definition at line 28 of file CaloSamples.cc.

References data_, i, and MAXSAMPLES.

{  
   for (int i=0; i<MAXSAMPLES; i++) data_[i]+=value;
   return (*this);
}
double CaloSamples::operator[] ( int  i) const [inline]

const operator to access samples

Definition at line 28 of file CaloSamples.h.

References data_, and i.

{ return data_[i]; }
double& CaloSamples::operator[] ( int  i) [inline]

mutable operator to access samples

Definition at line 26 of file CaloSamples.h.

References data_, and i.

{ return data_[i]; }
int CaloSamples::presamples ( ) const [inline]
CaloSamples & CaloSamples::scale ( double  value)

multiply each item by this value

Definition at line 21 of file CaloSamples.cc.

References data_, i, and MAXSAMPLES.

Referenced by operator*=().

{
   for (int i=0; i<MAXSAMPLES; i++) data_[i]*=value;
   return (*this);
}
void CaloSamples::setBlank ( )

Definition at line 45 of file CaloSamples.cc.

References data_, and MAXSAMPLES.

Referenced by CaloSamples().

{
   std::fill( data_ , data_ + MAXSAMPLES, (double)0.0 ) ;
}
void CaloSamples::setDetId ( DetId  detId) [inline]

Definition at line 43 of file CaloSamples.h.

References id_.

{ id_ = detId ; }
void CaloSamples::setPresamples ( int  pre)

set presample information

Definition at line 15 of file CaloSamples.cc.

References presamples_.

Referenced by HcalNominalCoder::adc2fC(), CastorNominalCoder::adc2fC(), HcalCoderDb::adc2fC_(), and CastorCoderDb::adc2fC_().

{
   presamples_ = pre ;
}
void CaloSamples::setSize ( unsigned int  size) [inline]

Definition at line 45 of file CaloSamples.h.

References size(), and size_.

{ size_ = size ; }
int CaloSamples::size ( void  ) const [inline]

Member Data Documentation

double CaloSamples::data_[MAXSAMPLES] [private]

Definition at line 54 of file CaloSamples.h.

Referenced by isBlank(), operator+=(), operator[](), scale(), and setBlank().

Definition at line 53 of file CaloSamples.h.

Referenced by id(), and setDetId().

const int CaloSamples::MAXSAMPLES = 10 [static]
int CaloSamples::presamples_ [private]

Definition at line 55 of file CaloSamples.h.

Referenced by presamples(), and setPresamples().

int CaloSamples::size_ [private]

Definition at line 55 of file CaloSamples.h.

Referenced by setSize(), and size().