#include <CaloSamples.h>
Public Member Functions | |
CaloSamples () | |
CaloSamples (const DetId &id, int size) | |
CaloSamples (const DetId &id, int size, int preciseSize) | |
DetId | id () const |
get the (generic) id | |
bool | isBlank () const |
CaloSamples & | offsetTime (double offset) |
shift all the samples by a time, in ns, interpolating | |
CaloSamples & | operator*= (double value) |
scale all samples | |
CaloSamples & | operator+= (double value) |
add a value to all samples | |
CaloSamples & | operator+= (const CaloSamples &other) |
double & | operator[] (int i) |
mutable operator to access samples | |
double | operator[] (int i) const |
const operator to access samples | |
float | preciseAt (int i) const |
const function to access precise samples | |
float & | preciseAtMod (int i) |
mutable function to access precise samples | |
float | preciseDeltaT () const |
int | precisePresamples () const |
int | preciseSize () const |
get the size | |
int | presamples () const |
access presample information | |
void | resetPrecise () |
CaloSamples & | scale (double value) |
multiply each item by this value | |
void | setBlank () |
void | setDetId (DetId detId) |
void | setPrecise (int precisePresamples, float deltaT) |
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] |
float | deltaTprecise_ |
DetId | id_ |
std::vector< float > | preciseData_ |
int | precisePresamples_ |
int | preciseSize_ |
int | presamples_ |
int | size_ |
Class which represents the charge/voltage measurements of an event/channel with the ADC decoding performed.
Definition at line 16 of file CaloSamples.h.
CaloSamples::CaloSamples | ( | ) |
Definition at line 6 of file CaloSamples.cc.
References setBlank().
: id_(), size_(0), presamples_(0), preciseSize_(0), precisePresamples_(0) { setBlank() ; }
CaloSamples::CaloSamples | ( | const DetId & | id, |
int | size | ||
) | [explicit] |
Definition at line 8 of file CaloSamples.cc.
References setBlank().
: id_ ( id ) , size_ ( size ) , presamples_ ( 0 ) , deltaTprecise_ (0.0f) , preciseSize_(0), precisePresamples_(0) { setBlank() ; }
CaloSamples::CaloSamples | ( | const DetId & | id, |
int | size, | ||
int | preciseSize | ||
) | [explicit] |
Definition at line 16 of file CaloSamples.cc.
References setBlank().
: id_ ( id ) , size_ ( size ) , presamples_ ( 0 ) , deltaTprecise_ (0.0f) , preciseSize_(presize), precisePresamples_(0) { setBlank() ; }
DetId CaloSamples::id | ( | void | ) | const [inline] |
get the (generic) id
Definition at line 23 of file CaloSamples.h.
References id_.
Referenced by CaloHitResponse::add(), HcalSiPMHitResponse::add(), HcalAmplifier::addPedestals(), HPDIonFeedbackSim::addThermalNoise(), HcalAmplifier::amplify(), CastorAmplifier::amplify(), EcalMixingModuleValidation::computeSDBunchDigi(), HcalElectronicsSim::convert(), CastorElectronicsSim::convert(), HcalTimeSlewSim::delay(), ESElectronicsSim::encode(), HcalCoderDb::fC2adc_(), CastorCoderDb::fC2adc_(), HcalBaseSignalGenerator::fC2pe(), HcalCoderDb::fCUpgrade2adc_(), HcalSiPMHitResponse::finalizeHits(), operator<<(), HcalAmplifier::pe2fC(), CastorNominalCoderTemplate::process(), HcalNominalCoderTemplate::process(), and edm::DataMixingHcalDigiWorker::putHcal().
{ return id_; }
bool CaloSamples::isBlank | ( | ) | const |
Definition at line 88 of file CaloSamples.cc.
References data_, alignCSCRings::e, funct::false, i, MAXSAMPLES, and funct::true.
Referenced by CaloHitRespoNew::findSignal().
CaloSamples & CaloSamples::offsetTime | ( | double | offset | ) |
shift all the samples by a time, in ns, interpolating
Definition at line 67 of file CaloSamples.cc.
References data, data_, f, i, MAXSAMPLES, evf::evtn::offset(), and lumiQTWidget::t.
Referenced by HcalTimeSlewSim::delay().
{ double data[MAXSAMPLES]; for( int i ( 0 ) ; i != MAXSAMPLES ; ++i ) { double t = i*25. - offset; int firstbin = floor(t/25.); double f = t/25. - firstbin; int nextbin = firstbin + 1; double v1 = (firstbin < 0 || firstbin >= MAXSAMPLES) ? 0. : data_[firstbin]; double v2 = (nextbin < 0 || nextbin >= MAXSAMPLES) ? 0. : data_[nextbin]; data[i] = (v1*(1.-f)+v2*f); } for( int i ( 0 ) ; i != MAXSAMPLES ; ++i ) { data_[i] = data[i]; } return (*this); }
CaloSamples& CaloSamples::operator*= | ( | double | value | ) | [inline] |
CaloSamples & CaloSamples::operator+= | ( | double | value | ) |
add a value to all samples
Definition at line 40 of file CaloSamples.cc.
References data_, deltaTprecise_, i, j, MAXSAMPLES, and preciseData_.
{ for (int i=0; i<MAXSAMPLES; i++) data_[i]+=value; for (std::vector<float>::iterator j=preciseData_.begin() ; j!=preciseData_.end(); j++) (*j)+=value*deltaTprecise_/25.0; // note that the scale is conserved! return (*this); }
CaloSamples & CaloSamples::operator+= | ( | const CaloSamples & | other | ) |
Definition at line 47 of file CaloSamples.cc.
References data_, i, preciseData_, preciseSize_, presamples_, resetPrecise(), and size_.
{ if(size_ != other.size_ || presamples_ != other.presamples_ || preciseSize_ != other.preciseSize_) { edm::LogError("CaloHitResponse") << "Mismatched calo signals "; } int i; for(i = 0; i < size_; ++i) { data_[i] += other.data_[i]; } if ( preciseData_.size() == 0 && other.preciseData_.size() > 0 ) resetPrecise(); if ( other.preciseData_.size() > 0 ) { for(i = 0; i < preciseSize_; ++i) { preciseData_[i] += other.preciseData_[i]; } } return *this; }
double CaloSamples::operator[] | ( | int | i | ) | const [inline] |
double& CaloSamples::operator[] | ( | int | i | ) | [inline] |
float CaloSamples::preciseAt | ( | int | i | ) | const [inline] |
const function to access precise samples
Definition at line 35 of file CaloSamples.h.
References i, and preciseData_.
Referenced by HcalTDC::timing().
{ return preciseData_[i]; }
float& CaloSamples::preciseAtMod | ( | int | i | ) | [inline] |
mutable function to access precise samples
Definition at line 33 of file CaloSamples.h.
References i, and preciseData_.
Referenced by HcalSiPMHitResponse::differentiatePreciseSamples(), and HcalSiPMHitResponse::makeSiPMSignal().
{ return preciseData_[i]; }
float CaloSamples::preciseDeltaT | ( | ) | const [inline] |
Definition at line 66 of file CaloSamples.h.
References deltaTprecise_.
Referenced by HcalSiPMHitResponse::differentiatePreciseSamples().
{ return deltaTprecise_; }
int CaloSamples::precisePresamples | ( | ) | const [inline] |
Definition at line 65 of file CaloSamples.h.
References precisePresamples_.
Referenced by setPrecise().
{ return precisePresamples_; }
int CaloSamples::preciseSize | ( | ) | const [inline] |
get the size
Definition at line 64 of file CaloSamples.h.
References preciseData_, and preciseSize_.
Referenced by HcalSiPMHitResponse::differentiatePreciseSamples(), HcalSiPMHitResponse::makeSiPMSignal(), operator<<(), and HcalTDC::timing().
{ if ( preciseData_.size() ==0 ) return 0; return preciseSize_; }
int CaloSamples::presamples | ( | ) | const [inline] |
access presample information
Definition at line 38 of file CaloSamples.h.
References presamples_.
Referenced by CaloHitResponse::add(), HcalTimeSlewSim::charge(), HcalCoderDb::fC2adc_(), CastorCoderDb::fC2adc_(), HcalCoderDb::fCUpgrade2adc_(), CastorNominalCoderTemplate::process(), and HcalNominalCoderTemplate::process().
{ return presamples_; }
void CaloSamples::resetPrecise | ( | ) |
Definition at line 25 of file CaloSamples.cc.
References preciseData_, and preciseSize_.
Referenced by HcalSiPMHitResponse::makeSiPMSignal(), and operator+=().
{ preciseData_.resize(preciseSize_,0); }
CaloSamples & CaloSamples::scale | ( | double | value | ) |
multiply each item by this value
Definition at line 33 of file CaloSamples.cc.
References data_, i, j, MAXSAMPLES, preciseData_, and relativeConstraints::value.
Referenced by operator*=().
{ for (int i=0; i<MAXSAMPLES; i++) data_[i]*=value; for (std::vector<float>::iterator j=preciseData_.begin() ; j!=preciseData_.end(); j++) (*j)*=value; return (*this); }
void CaloSamples::setBlank | ( | ) |
Definition at line 98 of file CaloSamples.cc.
References data_, lumiContext::fill, MAXSAMPLES, and preciseData_.
Referenced by CaloSamples().
{ std::fill( data_ , data_ + MAXSAMPLES, (double)0.0 ) ; std::fill( preciseData_.begin() , preciseData_.end(), (double)0.0 ) ; }
void CaloSamples::setDetId | ( | DetId | detId | ) | [inline] |
void CaloSamples::setPrecise | ( | int | precisePresamples, |
float | deltaT | ||
) | [inline] |
Definition at line 68 of file CaloSamples.h.
References deltaTprecise_, precisePresamples(), and precisePresamples_.
{ precisePresamples_=precisePresamples; deltaTprecise_=deltaT; }
void CaloSamples::setPresamples | ( | int | pre | ) |
set presample information
Definition at line 29 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] |
int CaloSamples::size | ( | void | ) | const [inline] |
get the size
Definition at line 26 of file CaloSamples.h.
References size_.
Referenced by CaloHitResponse::add(), HcalAmplifier::addPedestals(), HPDIonFeedbackSim::addThermalNoise(), CastorAmplifier::amplify(), ESElectronicsSim::analogToDigital(), HcalTimeSlewSim::charge(), HcalElectronicsSim::convert(), CastorElectronicsSim::convert(), ESElectronicsSim::encode(), HcalCoderDb::fC2adc_(), CastorCoderDb::fC2adc_(), HcalCoderDb::fCUpgrade2adc_(), reco::HcalNoiseInfoProducer::filldigis(), GlobalDigisAnalyzer::fillHCal(), GlobalDigisProducer::fillHCal(), HcalSiPMHitResponse::finalizeHits(), CaloHitResponse::makeAnalogSignal(), HcalSiPMHitResponse::makeSiPMSignal(), operator<<(), CastorNominalCoderTemplate::process(), HcalNominalCoderTemplate::process(), CaloHitRespoNew::putAnalogSignal(), edm::DataMixingHcalDigiWorker::putHcal(), HcalDigiTester::reco(), HcalSimpleRecAlgoImpl::reco(), CastorSimpleRecAlgoImpl::reco(), ZdcSimpleRecAlgoImpl::reco1(), ZdcSimpleRecAlgoImpl::reco2(), HcalSimpleRecAlgo::reconstruct(), HcalSimpleRecAlgo::reconstructHFUpgrade(), setSize(), and HcalTDC::timing().
{ return size_; }
double CaloSamples::data_[MAXSAMPLES] [private] |
Definition at line 78 of file CaloSamples.h.
Referenced by isBlank(), offsetTime(), operator+=(), operator[](), scale(), and setBlank().
float CaloSamples::deltaTprecise_ [private] |
Definition at line 80 of file CaloSamples.h.
Referenced by operator+=(), preciseDeltaT(), and setPrecise().
DetId CaloSamples::id_ [private] |
Definition at line 77 of file CaloSamples.h.
Referenced by id(), and setDetId().
const int CaloSamples::MAXSAMPLES = 10 [static] |
Definition at line 75 of file CaloSamples.h.
Referenced by EcalMixingModuleValidation::computeSDBunchDigi(), isBlank(), offsetTime(), operator+=(), scale(), and setBlank().
std::vector<float> CaloSamples::preciseData_ [private] |
Definition at line 81 of file CaloSamples.h.
Referenced by operator+=(), preciseAt(), preciseAtMod(), preciseSize(), resetPrecise(), scale(), and setBlank().
int CaloSamples::precisePresamples_ [private] |
Definition at line 82 of file CaloSamples.h.
Referenced by precisePresamples(), and setPrecise().
int CaloSamples::preciseSize_ [private] |
Definition at line 82 of file CaloSamples.h.
Referenced by operator+=(), preciseSize(), and resetPrecise().
int CaloSamples::presamples_ [private] |
Definition at line 79 of file CaloSamples.h.
Referenced by operator+=(), presamples(), and setPresamples().
int CaloSamples::size_ [private] |
Definition at line 79 of file CaloSamples.h.
Referenced by operator+=(), setSize(), and size().