CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
EcalTimeDigi Class Reference

#include <EcalTimeDigi.h>

Public Types

typedef DetId key_type
 For the sorted collection. More...
 

Public Member Functions

 EcalTimeDigi ()
 
 EcalTimeDigi (const DetId &id)
 
const DetIdid () const
 
const float & operator[] (unsigned int i) const
 
const float & sample (unsigned int i) const
 
int sampleOfInterest () const
 Gets the BX==0 sample. If =-1 then it means that only OOT hits are present. More...
 
void setSample (unsigned int i, const float sam)
 
void setSampleOfInterest (int i)
 
void setSize (unsigned int size)
 
void setWaveform (float *waveform)
 
int size () const
 
void swap (EcalTimeDigi &rh)
 
std::vector< float > waveform () const
 

Static Public Attributes

static const unsigned int WAVEFORMSAMPLES = 250
 

Private Attributes

std::vector< float > data_
 
DetId id_
 
int sampleOfInterest_
 
unsigned int size_
 
std::vector< float > waveform_
 

Detailed Description

Definition at line 8 of file EcalTimeDigi.h.

Member Typedef Documentation

◆ key_type

For the sorted collection.

Definition at line 10 of file EcalTimeDigi.h.

Constructor & Destructor Documentation

◆ EcalTimeDigi() [1/2]

EcalTimeDigi::EcalTimeDigi ( )

Definition at line 7 of file EcalTimeDigi.cc.

unsigned int size_
Definition: EcalTimeDigi.h:41
int sampleOfInterest_
Definition: EcalTimeDigi.h:42
static const unsigned int WAVEFORMSAMPLES
Definition: EcalTimeDigi.h:37
static constexpr int MAXSAMPLES
std::vector< float > data_
Definition: EcalTimeDigi.h:44
std::vector< float > waveform_
Definition: EcalTimeDigi.h:43

◆ EcalTimeDigi() [2/2]

EcalTimeDigi::EcalTimeDigi ( const DetId id)
explicit

Definition at line 9 of file EcalTimeDigi.cc.

unsigned int size_
Definition: EcalTimeDigi.h:41
int sampleOfInterest_
Definition: EcalTimeDigi.h:42
static const unsigned int WAVEFORMSAMPLES
Definition: EcalTimeDigi.h:37
static constexpr int MAXSAMPLES
std::vector< float > data_
Definition: EcalTimeDigi.h:44
std::vector< float > waveform_
Definition: EcalTimeDigi.h:43

Member Function Documentation

◆ id()

const DetId& EcalTimeDigi::id ( ) const
inline

Definition at line 22 of file EcalTimeDigi.h.

References id_.

22 { return id_; }

◆ operator[]()

const float& EcalTimeDigi::operator[] ( unsigned int  i) const
inline

Definition at line 25 of file EcalTimeDigi.h.

References data_, and mps_fire::i.

25 { return data_[i]; }
std::vector< float > data_
Definition: EcalTimeDigi.h:44

◆ sample()

const float& EcalTimeDigi::sample ( unsigned int  i) const
inline

Definition at line 26 of file EcalTimeDigi.h.

References data_, and mps_fire::i.

26 { return data_[i]; }
std::vector< float > data_
Definition: EcalTimeDigi.h:44

◆ sampleOfInterest()

int EcalTimeDigi::sampleOfInterest ( ) const
inline

Gets the BX==0 sample. If =-1 then it means that only OOT hits are present.

Definition at line 34 of file EcalTimeDigi.h.

References sampleOfInterest_.

34 { return sampleOfInterest_; }
int sampleOfInterest_
Definition: EcalTimeDigi.h:42

◆ setSample()

void EcalTimeDigi::setSample ( unsigned int  i,
const float  sam 
)
inline

Definition at line 30 of file EcalTimeDigi.h.

References data_, and mps_fire::i.

30 { data_[i] = sam; }
std::vector< float > data_
Definition: EcalTimeDigi.h:44

◆ setSampleOfInterest()

void EcalTimeDigi::setSampleOfInterest ( int  i)
inline

Definition at line 31 of file EcalTimeDigi.h.

References mps_fire::i, and sampleOfInterest_.

31 { sampleOfInterest_ = i; }
int sampleOfInterest_
Definition: EcalTimeDigi.h:42

◆ setSize()

void EcalTimeDigi::setSize ( unsigned int  size)

Definition at line 12 of file EcalTimeDigi.cc.

References data_, MAXSAMPLES, size(), and size_.

12  {
13  size_ = size;
14  if (size > MAXSAMPLES)
15  data_.resize(size_);
16 }
unsigned int size_
Definition: EcalTimeDigi.h:41
int size() const
Definition: EcalTimeDigi.h:23
static constexpr int MAXSAMPLES
std::vector< float > data_
Definition: EcalTimeDigi.h:44

◆ setWaveform()

void EcalTimeDigi::setWaveform ( float *  waveform)

Definition at line 18 of file EcalTimeDigi.cc.

References mps_fire::i, parallelization::uint, waveform(), waveform_, and WAVEFORMSAMPLES.

18  {
19  waveform_.resize(WAVEFORMSAMPLES);
20  for (uint i(0); i != WAVEFORMSAMPLES; ++i) {
21  waveform_[i] = waveform[i];
22  }
23 }
std::vector< float > waveform() const
Definition: EcalTimeDigi.h:35
static const unsigned int WAVEFORMSAMPLES
Definition: EcalTimeDigi.h:37
std::vector< float > waveform_
Definition: EcalTimeDigi.h:43

◆ size()

int EcalTimeDigi::size ( void  ) const
inline

Definition at line 23 of file EcalTimeDigi.h.

References size_.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and setSize().

23 { return size_; }
unsigned int size_
Definition: EcalTimeDigi.h:41

◆ swap()

void EcalTimeDigi::swap ( EcalTimeDigi rh)
inline

Definition at line 15 of file EcalTimeDigi.h.

References data_, id_, size_, swap(), and waveform_.

15  {
16  std::swap(id_, rh.id_);
17  std::swap(size_, rh.size_);
19  std::swap(data_, rh.data_);
20  }
unsigned int size_
Definition: EcalTimeDigi.h:41
void swap(EcalTimeDigi &lh, EcalTimeDigi &rh)
Definition: EcalTimeDigi.h:47
std::vector< float > data_
Definition: EcalTimeDigi.h:44
std::vector< float > waveform_
Definition: EcalTimeDigi.h:43

◆ waveform()

std::vector<float> EcalTimeDigi::waveform ( ) const
inline

Definition at line 35 of file EcalTimeDigi.h.

References waveform_.

Referenced by setWaveform().

35 { return waveform_; }
std::vector< float > waveform_
Definition: EcalTimeDigi.h:43

Member Data Documentation

◆ data_

std::vector<float> EcalTimeDigi::data_
private

Definition at line 44 of file EcalTimeDigi.h.

Referenced by operator[](), sample(), setSample(), setSize(), and swap().

◆ id_

DetId EcalTimeDigi::id_
private

Definition at line 40 of file EcalTimeDigi.h.

Referenced by id(), and swap().

◆ sampleOfInterest_

int EcalTimeDigi::sampleOfInterest_
private

Definition at line 42 of file EcalTimeDigi.h.

Referenced by sampleOfInterest(), and setSampleOfInterest().

◆ size_

unsigned int EcalTimeDigi::size_
private

Definition at line 41 of file EcalTimeDigi.h.

Referenced by setSize(), size(), and swap().

◆ waveform_

std::vector<float> EcalTimeDigi::waveform_
private

Definition at line 43 of file EcalTimeDigi.h.

Referenced by setWaveform(), swap(), and waveform().

◆ WAVEFORMSAMPLES

const unsigned int EcalTimeDigi::WAVEFORMSAMPLES = 250
static

Definition at line 37 of file EcalTimeDigi.h.

Referenced by setWaveform().