CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes | Private Attributes
CaloSamples Class Reference

#include <CaloSamples.h>

Public Member Functions

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

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:
2011/06/02 00:31:13
Revision:
1.5

Definition at line 15 of file CaloSamples.h.

Constructor & Destructor Documentation

CaloSamples::CaloSamples ( )

Definition at line 4 of file CaloSamples.cc.

References setBlank().

4 : id_(), size_(0), presamples_(0) { setBlank() ; }
void setBlank()
Definition: CaloSamples.cc:66
int presamples_
Definition: CaloSamples.h:59
CaloSamples::CaloSamples ( const DetId id,
int  size 
)
explicit

Definition at line 6 of file CaloSamples.cc.

References setBlank().

6  :
7  id_ ( id ) ,
8  size_ ( size ) ,
9  presamples_ ( 0 )
10 {
11  setBlank() ;
12 }
void setBlank()
Definition: CaloSamples.cc:66
int size() const
get the size
Definition: CaloSamples.h:24
int presamples_
Definition: CaloSamples.h:59

Member Function Documentation

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

Definition at line 56 of file CaloSamples.cc.

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

Referenced by CaloHitRespoNew::findSignal().

57 {
58  for( int i ( 0 ) ; i != MAXSAMPLES ; ++i )
59  {
60  if( 1.e-6 < fabs( data_[i] ) ) return false ;
61  }
62  return true ;
63 }
int i
Definition: DBlmapReader.cc:9
static const int MAXSAMPLES
Definition: CaloSamples.h:55
double data_[MAXSAMPLES]
Definition: CaloSamples.h:58
CaloSamples & CaloSamples::offsetTime ( double  offset)

shift all the samples by a time, in ns, interpolating

Definition at line 35 of file CaloSamples.cc.

References data, data_, f, i, MAXSAMPLES, evf::evtn::offset(), and lumiQTWidget::t.

Referenced by HcalTimeSlewSim::delay().

36 {
37  double data[MAXSAMPLES];
38  for( int i ( 0 ) ; i != MAXSAMPLES ; ++i )
39  {
40  double t = i*25. - offset;
41  int firstbin = floor(t/25.);
42  double f = t/25. - firstbin;
43  int nextbin = firstbin + 1;
44  double v1 = (firstbin < 0 || firstbin >= MAXSAMPLES) ? 0. : data_[firstbin];
45  double v2 = (nextbin < 0 || nextbin >= MAXSAMPLES) ? 0. : data_[nextbin];
46  data[i] = (v1*(1.-f)+v2*f);
47  }
48  for( int i ( 0 ) ; i != MAXSAMPLES ; ++i )
49  {
50  data_[i] = data[i];
51  }
52  return (*this);
53 }
int i
Definition: DBlmapReader.cc:9
static const int MAXSAMPLES
Definition: CaloSamples.h:55
double f[11][100]
unsigned int offset(bool)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double data_[MAXSAMPLES]
Definition: CaloSamples.h:58
CaloSamples& CaloSamples::operator*= ( double  value)
inline

scale all samples

Definition at line 38 of file CaloSamples.h.

References scale().

38 { return scale(value); }
CaloSamples & scale(double value)
multiply each item by this value
Definition: CaloSamples.cc:21
CaloSamples & CaloSamples::operator+= ( double  value)

add a value to all samples

Definition at line 28 of file CaloSamples.cc.

References data_, i, and MAXSAMPLES.

29 {
30  for (int i=0; i<MAXSAMPLES; i++) data_[i]+=value;
31  return (*this);
32 }
int i
Definition: DBlmapReader.cc:9
static const int MAXSAMPLES
Definition: CaloSamples.h:55
double data_[MAXSAMPLES]
Definition: CaloSamples.h:58
double& CaloSamples::operator[] ( int  i)
inline

mutable operator to access samples

Definition at line 26 of file CaloSamples.h.

References data_, and i.

26 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
double data_[MAXSAMPLES]
Definition: CaloSamples.h:58
double CaloSamples::operator[] ( int  i) const
inline

const operator to access samples

Definition at line 28 of file CaloSamples.h.

References data_, and i.

28 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
double data_[MAXSAMPLES]
Definition: CaloSamples.h:58
int CaloSamples::presamples ( ) const
inline
CaloSamples & CaloSamples::scale ( double  value)
void CaloSamples::setBlank ( )

Definition at line 66 of file CaloSamples.cc.

References data_, lumiContext::fill, and MAXSAMPLES.

Referenced by CaloSamples().

67 {
68  std::fill( data_ , data_ + MAXSAMPLES, (double)0.0 ) ;
69 }
string fill
Definition: lumiContext.py:319
static const int MAXSAMPLES
Definition: CaloSamples.h:55
double data_[MAXSAMPLES]
Definition: CaloSamples.h:58
void CaloSamples::setDetId ( DetId  detId)
inline

Definition at line 47 of file CaloSamples.h.

References id_.

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

set presample information

Definition at line 15 of file CaloSamples.cc.

References presamples_.

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

16 {
17  presamples_ = pre ;
18 }
int presamples_
Definition: CaloSamples.h:59
void CaloSamples::setSize ( unsigned int  size)
inline

Definition at line 49 of file CaloSamples.h.

References size(), and size_.

49 { size_ = size ; }
int size() const
get the size
Definition: CaloSamples.h:24
int CaloSamples::size ( void  ) const
inline

Member Data Documentation

double CaloSamples::data_[MAXSAMPLES]
private

Definition at line 58 of file CaloSamples.h.

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

DetId CaloSamples::id_
private

Definition at line 57 of file CaloSamples.h.

Referenced by id(), and setDetId().

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

Definition at line 59 of file CaloSamples.h.

Referenced by presamples(), and setPresamples().

int CaloSamples::size_
private

Definition at line 59 of file CaloSamples.h.

Referenced by setSize(), and size().