CMS 3D CMS Logo

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

#include <EcalMatacqDigi.h>

Public Types

typedef int key_type
 

Public Member Functions

const float adcCount (const int &i) const
 
const float amplitudeV (const int &i) const
 
int attenuation_dB () const
 
void attenuation_dB (int value)
 
int bxId () const
 
void bxId (int value)
 
int chId () const
 
int delayA () const
 
void delayA (int value)
 
 EcalMatacqDigi ()
 
 EcalMatacqDigi (const std::vector< Short_t > &samples, const int &chId, const double &ts, const short &version=-1, const double &tTrig=999.)
 
int emtcDelay () const
 
void emtcDelay (int value)
 
int emtcPhase () const
 
void emtcPhase (int value)
 
int id () const
 
void init ()
 
int l1a () const
 
void l1a (int value)
 
int laserPower () const
 
void laserPower (int value)
 
UInt_t orbitId () const
 
void orbitId (UInt_t value)
 
int postTrig () const
 
void postTrig (int value)
 
int size () const
 
void swap (std::vector< short > &samples)
 
void swap (EcalMatacqDigi &a)
 
timeval timeStamp () const
 
void timeStamp (timeval value)
 
int triggerType () const
 
void triggerType (int value)
 
int trigRec () const
 
void trigRec (int value)
 
float ts () const
 
float tTrig () const
 
std::vector< int > vernier () const
 
void vernier (const std::vector< int > &value)
 
short version () const
 

Static Public Attributes

static const double lsb_ = 0.25e-3
 
static const int MAXSAMPLES = 2560
 

Private Attributes

char attenuation_dB_
 
Short_t bxId_
 
int chId_
 
std::vector< Short_t > data_
 
Int_t delayA_
 
Int_t emtcDelay_
 
Int_t emtcPhase_
 
int freq
 
Int_t l1a_
 
Int_t laserPower_
 
Int_t orbitId_
 
Short_t postTrig_
 
char triggerType_
 
Short_t trigRec_
 
double ts_
 
double tTrigS_
 
Long64_t tv_sec_
 
Long64_t tv_usec_
 
std::vector< Int_t > vernier_
 
short version_
 

Detailed Description

Definition at line 16 of file EcalMatacqDigi.h.

Member Typedef Documentation

Definition at line 27 of file EcalMatacqDigi.h.

Constructor & Destructor Documentation

EcalMatacqDigi::EcalMatacqDigi ( )
inline

Default constructor.

Definition at line 32 of file EcalMatacqDigi.h.

References init().

32  : chId_(-1), ts_(0.), tTrigS_(999.), version_(-1){
33  init();
34  }
EcalMatacqDigi::EcalMatacqDigi ( const std::vector< Short_t > &  samples,
const int &  chId,
const double &  ts,
const short &  version = -1,
const double &  tTrig = 999. 
)
inline

Constructor

Parameters
samplesadc time samples
chIdMatacq channel ID
tssampling time in seconds
versionMatacq raw data private version
tTriggtime position of the trigger in seconds

Definition at line 43 of file EcalMatacqDigi.h.

References init().

45  : chId_(chId), data_(samples), ts_(ts), tTrigS_(tTrig),
47  init();
48  };
float ts() const
float tTrig() const
short version() const
int chId() const
std::vector< Short_t > data_

Member Function Documentation

const float EcalMatacqDigi::adcCount ( const int &  i) const
inline

Gets amplitude in ADC count of time sample i. i between 0 and size()-1. Note: Amplitude is pedestal subtracted at acquisition time.

Definition at line 54 of file EcalMatacqDigi.h.

References data_, and i.

Referenced by EcalMatacqAnalyzer::analyze(), and EcalPerEvtMatacqAnalyzer::analyze().

54 { return data_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< Short_t > data_
const float EcalMatacqDigi::amplitudeV ( const int &  i) const
inline

Gets amplitude in Volt of time sample i. i between 0 and size()-1. Note: Amplitude is pedestal subtracted at acquisition time.

Definition at line 59 of file EcalMatacqDigi.h.

References data_, i, and lsb_.

Referenced by operator<<().

59 { return data_[i]*lsb_;}
int i
Definition: DBlmapReader.cc:9
static const double lsb_
std::vector< Short_t > data_
int EcalMatacqDigi::attenuation_dB ( ) const
inline

Gets the laser logarithmic attenuator setting in -10dB unit. Between 0 and 5*(-10dB), -1 if unknown.

Returns
attenuation_dB

Definition at line 248 of file EcalMatacqDigi.h.

References attenuation_dB_.

Referenced by MatacqDataFormatter::interpretRawData().

248 { return attenuation_dB_; }
void EcalMatacqDigi::attenuation_dB ( int  value)
inline

Sets the laser Logarithmic attenuator setting in -10dB unit. Between 0 and 5*(-10dB), -1 if unknown.

Parameters
valuenew value

Definition at line 254 of file EcalMatacqDigi.h.

References attenuation_dB_, and relativeConstraints::value.

int EcalMatacqDigi::bxId ( ) const
inline

Sets the raw data format, the digi is issued from.

Parameters
versioninternal matacq raw data format version Gets the bunch crossing id field contents.
Returns
BX id

Definition at line 132 of file EcalMatacqDigi.h.

References bxId_.

Referenced by MatacqDataFormatter::interpretRawData().

132 { return bxId_; }
void EcalMatacqDigi::bxId ( int  value)
inline

Sets the bunch crossing id field contents.

Parameters
valuenew value

Definition at line 137 of file EcalMatacqDigi.h.

References bxId_, and relativeConstraints::value.

int EcalMatacqDigi::chId ( ) const
inline

Gets Matacq electronics channel id

Definition at line 63 of file EcalMatacqDigi.h.

References chId_.

63 { return chId_;}
int EcalMatacqDigi::delayA ( ) const
inline

Gets "Delay A" setting of laser delay box in ns.delayA

Returns
delayA

Definition at line 217 of file EcalMatacqDigi.h.

References delayA_.

Referenced by MatacqDataFormatter::interpretRawData().

217 { return delayA_; }
void EcalMatacqDigi::delayA ( int  value)
inline

Sets "Delay A" setting of laser delay box in ns.delayA

Parameters
valuenew value

Definition at line 222 of file EcalMatacqDigi.h.

References delayA_, and relativeConstraints::value.

int EcalMatacqDigi::emtcDelay ( ) const
inline

Gets the WTE-to-Laser delay of EMTC in LHC clock unit.

Returns
emtcDelay

Definition at line 227 of file EcalMatacqDigi.h.

References emtcDelay_.

Referenced by MatacqDataFormatter::interpretRawData().

227 { return emtcDelay_; }
void EcalMatacqDigi::emtcDelay ( int  value)
inline

Sets the WTE-to-Laser delay of EMTC in LHC clock unit.

Parameters
valuenew value

Definition at line 232 of file EcalMatacqDigi.h.

References emtcDelay_, and relativeConstraints::value.

int EcalMatacqDigi::emtcPhase ( ) const
inline

Gets the EMTC laser phase in 1/8th LHC clock unit.

Returns
emtcPhase

Definition at line 237 of file EcalMatacqDigi.h.

References emtcPhase_.

Referenced by MatacqDataFormatter::interpretRawData().

237 { return emtcPhase_; }
void EcalMatacqDigi::emtcPhase ( int  value)
inline

Sets the EMTC laser phase in 1/8th LHC clock unit.

Parameters
valuenew value

Definition at line 242 of file EcalMatacqDigi.h.

References emtcPhase_, and relativeConstraints::value.

int EcalMatacqDigi::id ( ) const
inline

For edm::SortedCollection.

Returns
as key the matacq channel id

Definition at line 68 of file EcalMatacqDigi.h.

References chId_.

68 { return chId_;}
void EcalMatacqDigi::init ( void  )
inline

Definition at line 268 of file EcalMatacqDigi.h.

References attenuation_dB_, bxId_, delayA_, emtcDelay_, emtcPhase_, l1a_, laserPower_, orbitId_, postTrig_, triggerType_, trigRec_, and vernier_.

Referenced by EcalMatacqDigi().

268  {
269 #if (ECAL_MATACQ_DIGI_VERS>=2)
270  bxId_ = -1;
271  l1a_ = -1;
272  triggerType_ = -1;
273  orbitId_ = -1;
274  trigRec_ = -1;
275  postTrig_ = -1;
276  vernier_ = std::vector<Int_t>(4,-1);
277  delayA_ = -1;
278  emtcDelay_ = -1;
279  emtcPhase_ = -1;
280  attenuation_dB_ = -1;
281  laserPower_ = -1;
282 #endif
283  }
std::vector< Int_t > vernier_
int EcalMatacqDigi::l1a ( ) const
inline

Gets level one accept counter of the event

Returns
l1a

Definition at line 142 of file EcalMatacqDigi.h.

References l1a_.

Referenced by MatacqDataFormatter::interpretRawData().

142 { return l1a_; }
void EcalMatacqDigi::l1a ( int  value)
inline

Sets level one accept counter of the event

Parameters
valuenew value

Definition at line 147 of file EcalMatacqDigi.h.

References l1a_, and relativeConstraints::value.

int EcalMatacqDigi::laserPower ( ) const
inline

Gets the laser power setting in percents (set with the linear attenuator),

Returns
laserPower

Definition at line 260 of file EcalMatacqDigi.h.

References laserPower_.

Referenced by MatacqDataFormatter::interpretRawData().

260 { return laserPower_; }
void EcalMatacqDigi::laserPower ( int  value)
inline

Sets the laser power setting in percents (set with the linear attenuator),

Parameters
valuenew value

Definition at line 266 of file EcalMatacqDigi.h.

References laserPower_, and relativeConstraints::value.

UInt_t EcalMatacqDigi::orbitId ( ) const
inline

Gets the LHC orbit ID of the event Available only for Matacq data format version >=3 and for P5 data.

Returns
the LHC orbit ID

Definition at line 175 of file EcalMatacqDigi.h.

References orbitId_.

Referenced by MatacqDataFormatter::interpretRawData().

175 { return orbitId_; }
void EcalMatacqDigi::orbitId ( UInt_t  value)
inline

Sets the LHC orbit ID of the event.

Parameters
valuenew value

Definition at line 180 of file EcalMatacqDigi.h.

References orbitId_, and relativeConstraints::value.

int EcalMatacqDigi::postTrig ( ) const
inline

Gets the Posttrig value (see Matacq documentation). Available only for Matacq data format version >=3.

Definition at line 196 of file EcalMatacqDigi.h.

References postTrig_.

Referenced by MatacqDataFormatter::interpretRawData().

196 { return postTrig_; }
void EcalMatacqDigi::postTrig ( int  value)
inline

Sets the Posttrig value (see Matacq documentation).

Parameters
valuenew value

Definition at line 201 of file EcalMatacqDigi.h.

References postTrig_, and relativeConstraints::value.

int EcalMatacqDigi::size ( void  ) const
inline

Sets Matacq electronics channel idNumber of time samples

Definition at line 76 of file EcalMatacqDigi.h.

References data_.

Referenced by EcalMatacqAnalyzer::analyze(), EcalPerEvtMatacqAnalyzer::analyze(), and operator<<().

76 { return data_.size();}
std::vector< Short_t > data_
void EcalMatacqDigi::swap ( std::vector< short > &  samples)
inline

Swaps samples with the passed samples. For package internal use.

Parameters
samplesnew time samples in unit used in raw data (a priori ADC count).

Definition at line 82 of file EcalMatacqDigi.h.

References data_, and std::swap().

82 { std::swap(data_, samples);}
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< Short_t > data_
void EcalMatacqDigi::swap ( EcalMatacqDigi a)

Definition at line 24 of file EcalMatacqDigi.cc.

References attenuation_dB_, bxId_, chId_, data_, delayA_, emtcDelay_, emtcPhase_, l1a_, laserPower_, orbitId_, postTrig_, std::swap(), triggerType_, trigRec_, ts_, tTrigS_, tv_sec_, tv_usec_, vernier_, and version_.

24  {
25  data_.swap(a.data_);
26  std::swap(chId_, a.chId_);
27  std::swap(ts_, a.ts_);
30 #if (ECAL_MATACQ_DIGI_VERS>=2)
31  std::swap(bxId_, a.bxId_);
32  std::swap(l1a_, a.l1a_);
45 #endif
46 }
std::vector< Int_t > vernier_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< Short_t > data_
timeval EcalMatacqDigi::timeStamp ( ) const
inline

Gets the matacq data timestamp with fine granularity (89.1us)

Returns
acquisition date of the data expressed in number of "elapsed" second and microseconds since the EPOCH as defined in POSIX.1. See time() standard c function and gettimeofday UNIX function.

Definition at line 164 of file EcalMatacqDigi.h.

References tv_sec_, tv_usec_, and relativeConstraints::value.

Referenced by MatacqDataFormatter::interpretRawData().

164 { timeval value; value.tv_sec = tv_sec_; value.tv_usec = tv_usec_; return value; }
void EcalMatacqDigi::timeStamp ( timeval  value)
inline

Sets the matcq event timestmap

Parameters
valuenew value

Definition at line 169 of file EcalMatacqDigi.h.

References tv_sec_, and tv_usec_.

169 { tv_sec_ = value.tv_sec; tv_usec_ = value.tv_usec; }
int EcalMatacqDigi::triggerType ( ) const
inline

Gets type of test trigger

Returns
triggerType

Definition at line 152 of file EcalMatacqDigi.h.

References triggerType_.

Referenced by MatacqDataFormatter::interpretRawData().

152 { return triggerType_; }
void EcalMatacqDigi::triggerType ( int  value)
inline

Sets type of test trigger

Parameters
valuenew value

Definition at line 157 of file EcalMatacqDigi.h.

References triggerType_, and relativeConstraints::value.

int EcalMatacqDigi::trigRec ( ) const
inline

Gets the Trig Rec value (see Matacq documentation) Available only for Matacq data format version >=3.

Returns
the Trig Rec value

Definition at line 186 of file EcalMatacqDigi.h.

References trigRec_.

Referenced by MatacqDataFormatter::interpretRawData().

186 { return trigRec_; }
void EcalMatacqDigi::trigRec ( int  value)
inline

Sets the Trig Rec value (see Matacq documentation)

Parameters
valuenew value

Definition at line 191 of file EcalMatacqDigi.h.

References trigRec_, and relativeConstraints::value.

float EcalMatacqDigi::ts ( ) const
inline

Gets time of sample i. i between 0 and size()-1.Gets sampling time in seconds

Definition at line 92 of file EcalMatacqDigi.h.

References ts_.

92 { return ts_;}
float EcalMatacqDigi::tTrig ( ) const
inline

Sets sampling time period

Parameters
tssampling time period in seconds Gets time of trigger in seconds.
Returns
(t_trig-t_0), with t_trig the trigger time and t_0 the first. Returns 999 if not available. sample time.

Definition at line 106 of file EcalMatacqDigi.h.

References tTrigS_.

Referenced by EcalMatacqAnalyzer::analyze(), and EcalPerEvtMatacqAnalyzer::analyze().

106 { return tTrigS_;}
std::vector<int> EcalMatacqDigi::vernier ( ) const
inline

Gets the vernier values (see Matacq documentation)

Returns
verniers

Definition at line 206 of file EcalMatacqDigi.h.

References vernier_.

Referenced by MatacqDataFormatter::interpretRawData().

206 { return vernier_; }
std::vector< Int_t > vernier_
void EcalMatacqDigi::vernier ( const std::vector< int > &  value)
inline

Sets verniers

Parameters
valuenew value

Definition at line 211 of file EcalMatacqDigi.h.

References relativeConstraints::value, and vernier_.

211 { vernier_ = value; }
std::vector< Int_t > vernier_
short EcalMatacqDigi::version ( ) const
inline

Sets trigger time position

Parameters
tTrigS(t_trig-t_0) in seconds, with t_trig the time of MATACQ trigger and t_0 the time of the first sample of each MATACQ channel. version of raw data format, the digis originate from.
Returns
raw data format version, -1 if not available.

Definition at line 119 of file EcalMatacqDigi.h.

References version_.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

119 {return version_;}

Member Data Documentation

char EcalMatacqDigi::attenuation_dB_
private

Logarithmic attenuator setting in -10dB unit. Between 0 and 5*(-10dB), -1 if unknown.

Definition at line 321 of file EcalMatacqDigi.h.

Referenced by attenuation_dB(), init(), and swap().

Short_t EcalMatacqDigi::bxId_
private

Bunch crossing Id

Definition at line 325 of file EcalMatacqDigi.h.

Referenced by bxId(), init(), and swap().

int EcalMatacqDigi::chId_
private

Electronic channel id

Definition at line 290 of file EcalMatacqDigi.h.

Referenced by chId(), id(), and swap().

std::vector<Short_t> EcalMatacqDigi::data_
private

ADC count of time samples

Definition at line 294 of file EcalMatacqDigi.h.

Referenced by adcCount(), amplitudeV(), size(), and swap().

Int_t EcalMatacqDigi::delayA_
private

"Delay A" setting of laser delay box in ns.

Definition at line 349 of file EcalMatacqDigi.h.

Referenced by delayA(), init(), and swap().

Int_t EcalMatacqDigi::emtcDelay_
private

WTE-to-Laser delay of EMTC in LHC clock unit.

Definition at line 353 of file EcalMatacqDigi.h.

Referenced by emtcDelay(), init(), and swap().

Int_t EcalMatacqDigi::emtcPhase_
private

EMTC laser phase in 1/8th LHC clock unit.

Definition at line 357 of file EcalMatacqDigi.h.

Referenced by emtcPhase(), init(), and swap().

int EcalMatacqDigi::freq
private

Frequency mode. 1->1GHz sampling, 2->2GHz sampling

Definition at line 298 of file EcalMatacqDigi.h.

Int_t EcalMatacqDigi::l1a_
private

Event id. Actually LV1 ID.

Definition at line 329 of file EcalMatacqDigi.h.

Referenced by init(), l1a(), and swap().

Int_t EcalMatacqDigi::laserPower_
private

Laser power in percents (set with the linear attenuator).

Definition at line 361 of file EcalMatacqDigi.h.

Referenced by init(), laserPower(), and swap().

const double EcalMatacqDigi::lsb_ = 0.25e-3
static

LSB of ADC count in Volt

Definition at line 20 of file EcalMatacqDigi.h.

Referenced by amplitudeV().

const int EcalMatacqDigi::MAXSAMPLES = 2560
static

Maximum number of time samples

Definition at line 24 of file EcalMatacqDigi.h.

Int_t EcalMatacqDigi::orbitId_
private

Definition at line 333 of file EcalMatacqDigi.h.

Referenced by init(), orbitId(), and swap().

Short_t EcalMatacqDigi::postTrig_
private

Posttrig value (see Matacq documentation)

Definition at line 341 of file EcalMatacqDigi.h.

Referenced by init(), postTrig(), and swap().

char EcalMatacqDigi::triggerType_
private

Type of test trigger

Returns
triggerType

Definition at line 316 of file EcalMatacqDigi.h.

Referenced by init(), swap(), and triggerType().

Short_t EcalMatacqDigi::trigRec_
private

Trig Rec value (see Matacq documentation)

Definition at line 337 of file EcalMatacqDigi.h.

Referenced by init(), swap(), and trigRec().

double EcalMatacqDigi::ts_
private

Sampling period in seconds. In priniciple 1ns or 0.5ns

Definition at line 302 of file EcalMatacqDigi.h.

Referenced by swap(), and ts().

double EcalMatacqDigi::tTrigS_
private

Trigger time in seconds

Definition at line 306 of file EcalMatacqDigi.h.

Referenced by swap(), and tTrig().

Long64_t EcalMatacqDigi::tv_sec_
private

Matacq acquisition time stampWe don't use timeval directly, because its typedef is platform dependent.

Definition at line 367 of file EcalMatacqDigi.h.

Referenced by swap(), and timeStamp().

Long64_t EcalMatacqDigi::tv_usec_
private

Definition at line 368 of file EcalMatacqDigi.h.

Referenced by swap(), and timeStamp().

std::vector<Int_t> EcalMatacqDigi::vernier_
private

Vernier values (see Matacq documentation)

Definition at line 345 of file EcalMatacqDigi.h.

Referenced by init(), swap(), and vernier().

short EcalMatacqDigi::version_
private

version of raw data format, the digis originate from.

Definition at line 310 of file EcalMatacqDigi.h.

Referenced by swap(), and version().