Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:04

0001 #include "DataFormats/EcalDigi/interface/EcalTimeDigi.h"
0002 
0003 namespace {
0004   constexpr unsigned int MAXSAMPLES = 10;
0005 }  // namespace
0006 
0007 EcalTimeDigi::EcalTimeDigi() : id_(0), size_(0), sampleOfInterest_(-1), waveform_(WAVEFORMSAMPLES), data_(MAXSAMPLES) {}
0008 
0009 EcalTimeDigi::EcalTimeDigi(const DetId& id)
0010     : id_(id), size_(0), sampleOfInterest_(-1), waveform_(WAVEFORMSAMPLES), data_(MAXSAMPLES) {}
0011 
0012 void EcalTimeDigi::setSize(unsigned int size) {
0013   size_ = size;
0014   if (size > MAXSAMPLES)
0015     data_.resize(size_);
0016 }
0017 
0018 void EcalTimeDigi::setWaveform(float* waveform) {
0019   waveform_.resize(WAVEFORMSAMPLES);
0020   for (uint i(0); i != WAVEFORMSAMPLES; ++i) {
0021     waveform_[i] = waveform[i];
0022   }
0023 }