CMS 3D CMS Logo

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

float adcCount (const int &i) 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_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

◆ key_type

Definition at line 27 of file EcalMatacqDigi.h.

Constructor & Destructor Documentation

◆ EcalMatacqDigi() [1/2]

EcalMatacqDigi::EcalMatacqDigi ( )
inline

Default constructor.

Definition at line 32 of file EcalMatacqDigi.h.

References init().

32 : chId_(-1), ts_(0.), tTrigS_(999.), version_(-1) { init(); }

◆ EcalMatacqDigi() [2/2]

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 41 of file EcalMatacqDigi.h.

References init().

47  init();
48  };
int chId() const
float tTrig() const
std::vector< Short_t > data_
float ts() const
short version() const

Member Function Documentation

◆ adcCount()

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 53 of file EcalMatacqDigi.h.

References data_, and mps_fire::i.

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

53 { return data_[i]; }
std::vector< Short_t > data_

◆ amplitudeV()

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 58 of file EcalMatacqDigi.h.

References data_, mps_fire::i, and lsb_.

Referenced by operator<<().

58 { return data_[i] * lsb_; }
static const double lsb_
std::vector< Short_t > data_

◆ attenuation_dB() [1/2]

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 254 of file EcalMatacqDigi.h.

References attenuation_dB_.

Referenced by MatacqDataFormatter::interpretRawData().

254 { return attenuation_dB_; }

◆ attenuation_dB() [2/2]

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 260 of file EcalMatacqDigi.h.

References attenuation_dB_, and relativeConstraints::value.

◆ bxId() [1/2]

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 131 of file EcalMatacqDigi.h.

References bxId_.

Referenced by MatacqDataFormatter::interpretRawData().

131 { return bxId_; }

◆ bxId() [2/2]

void EcalMatacqDigi::bxId ( int  value)
inline

Sets the bunch crossing id field contents.

Parameters
valuenew value

Definition at line 136 of file EcalMatacqDigi.h.

References bxId_, and relativeConstraints::value.

◆ chId()

int EcalMatacqDigi::chId ( ) const
inline

Gets Matacq electronics channel id

Definition at line 62 of file EcalMatacqDigi.h.

References chId_.

62 { return chId_; }

◆ delayA() [1/2]

int EcalMatacqDigi::delayA ( ) const
inline

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

Returns
delayA

Definition at line 223 of file EcalMatacqDigi.h.

References delayA_.

Referenced by MatacqDataFormatter::interpretRawData().

223 { return delayA_; }

◆ delayA() [2/2]

void EcalMatacqDigi::delayA ( int  value)
inline

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

Parameters
valuenew value

Definition at line 228 of file EcalMatacqDigi.h.

References delayA_, and relativeConstraints::value.

◆ emtcDelay() [1/2]

int EcalMatacqDigi::emtcDelay ( ) const
inline

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

Returns
emtcDelay

Definition at line 233 of file EcalMatacqDigi.h.

References emtcDelay_.

Referenced by MatacqDataFormatter::interpretRawData().

233 { return emtcDelay_; }

◆ emtcDelay() [2/2]

void EcalMatacqDigi::emtcDelay ( int  value)
inline

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

Parameters
valuenew value

Definition at line 238 of file EcalMatacqDigi.h.

References emtcDelay_, and relativeConstraints::value.

◆ emtcPhase() [1/2]

int EcalMatacqDigi::emtcPhase ( ) const
inline

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

Returns
emtcPhase

Definition at line 243 of file EcalMatacqDigi.h.

References emtcPhase_.

Referenced by MatacqDataFormatter::interpretRawData().

243 { return emtcPhase_; }

◆ emtcPhase() [2/2]

void EcalMatacqDigi::emtcPhase ( int  value)
inline

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

Parameters
valuenew value

Definition at line 248 of file EcalMatacqDigi.h.

References emtcPhase_, and relativeConstraints::value.

◆ id()

int EcalMatacqDigi::id ( ) const
inline

For edm::SortedCollection.

Returns
as key the matacq channel id

Definition at line 67 of file EcalMatacqDigi.h.

References chId_.

67 { return chId_; }

◆ init()

void EcalMatacqDigi::init ( void  )
inline

Definition at line 275 of file EcalMatacqDigi.h.

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

Referenced by EcalMatacqDigi().

275  {
276 #if (ECAL_MATACQ_DIGI_VERS >= 2)
277  bxId_ = -1;
278  l1a_ = -1;
279  triggerType_ = -1;
280  orbitId_ = -1;
281  trigRec_ = -1;
282  postTrig_ = -1;
283  vernier_ = std::vector<Int_t>(4, -1);
284  delayA_ = -1;
285  emtcDelay_ = -1;
286  emtcPhase_ = -1;
287  attenuation_dB_ = -1;
288  laserPower_ = -1;
289  tv_sec_ = 0;
290  tv_usec_ = 0;
291 #endif
292  }
std::vector< Int_t > vernier_

◆ l1a() [1/2]

int EcalMatacqDigi::l1a ( ) const
inline

Gets level one accept counter of the event

Returns
l1a

Definition at line 141 of file EcalMatacqDigi.h.

References l1a_.

Referenced by MatacqDataFormatter::interpretRawData().

141 { return l1a_; }

◆ l1a() [2/2]

void EcalMatacqDigi::l1a ( int  value)
inline

Sets level one accept counter of the event

Parameters
valuenew value

Definition at line 146 of file EcalMatacqDigi.h.

References l1a_, and relativeConstraints::value.

◆ laserPower() [1/2]

int EcalMatacqDigi::laserPower ( ) const
inline

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

Returns
laserPower

Definition at line 266 of file EcalMatacqDigi.h.

References laserPower_.

Referenced by MatacqDataFormatter::interpretRawData().

266 { return laserPower_; }

◆ laserPower() [2/2]

void EcalMatacqDigi::laserPower ( int  value)
inline

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

Parameters
valuenew value

Definition at line 272 of file EcalMatacqDigi.h.

References laserPower_, and relativeConstraints::value.

◆ orbitId() [1/2]

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 182 of file EcalMatacqDigi.h.

References orbitId_.

Referenced by MatacqDataFormatter::interpretRawData().

182 { return orbitId_; }

◆ orbitId() [2/2]

void EcalMatacqDigi::orbitId ( UInt_t  value)
inline

Sets the LHC orbit ID of the event.

Parameters
valuenew value

Definition at line 187 of file EcalMatacqDigi.h.

References orbitId_, and relativeConstraints::value.

◆ postTrig() [1/2]

int EcalMatacqDigi::postTrig ( ) const
inline

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

Definition at line 203 of file EcalMatacqDigi.h.

References postTrig_.

Referenced by MatacqDataFormatter::interpretRawData().

203 { return postTrig_; }

◆ postTrig() [2/2]

void EcalMatacqDigi::postTrig ( int  value)
inline

Sets the Posttrig value (see Matacq documentation).

Parameters
valuenew value

Definition at line 208 of file EcalMatacqDigi.h.

References postTrig_, and relativeConstraints::value.

◆ size()

int EcalMatacqDigi::size ( void  ) const
inline

Sets Matacq electronics channel idNumber of time samples

Definition at line 75 of file EcalMatacqDigi.h.

References data_.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), EcalPerEvtMatacqAnalyzer::analyze(), EcalMatacqAnalyzer::analyze(), and operator<<().

75 { return data_.size(); }
std::vector< Short_t > data_

◆ swap() [1/2]

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 81 of file EcalMatacqDigi.h.

References data_, EgammaValidation_cff::samples, and std::swap().

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

◆ swap() [2/2]

void EcalMatacqDigi::swap ( EcalMatacqDigi a)

Definition at line 24 of file EcalMatacqDigi.cc.

References a, and std::swap().

24  {
25  data_.swap(a.data_);
26  std::swap(chId_, a.chId_);
27  std::swap(ts_, a.ts_);
28  std::swap(tTrigS_, a.tTrigS_);
29  std::swap(version_, a.version_);
30 #if (ECAL_MATACQ_DIGI_VERS >= 2)
31  std::swap(bxId_, a.bxId_);
32  std::swap(l1a_, a.l1a_);
33  std::swap(triggerType_, a.triggerType_);
34  std::swap(orbitId_, a.orbitId_);
35  std::swap(trigRec_, a.trigRec_);
36  std::swap(postTrig_, a.postTrig_);
37  std::swap(vernier_, a.vernier_);
38  std::swap(delayA_, a.delayA_);
39  std::swap(emtcDelay_, a.emtcDelay_);
40  std::swap(emtcPhase_, a.emtcPhase_);
41  std::swap(attenuation_dB_, a.attenuation_dB_);
42  std::swap(laserPower_, a.laserPower_);
43  std::swap(tv_sec_, a.tv_sec_);
44  std::swap(tv_usec_, a.tv_usec_);
45 #endif
46 }
std::vector< Int_t > vernier_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< Short_t > data_
double a
Definition: hdecay.h:119

◆ timeStamp() [1/2]

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 163 of file EcalMatacqDigi.h.

References tv_sec_, tv_usec_, and relativeConstraints::value.

Referenced by MatacqDataFormatter::interpretRawData().

163  {
164  timeval value;
165  value.tv_sec = tv_sec_;
166  value.tv_usec = tv_usec_;
167  return value;
168  }
Definition: value.py:1

◆ timeStamp() [2/2]

void EcalMatacqDigi::timeStamp ( timeval  value)
inline

Sets the matcq event timestmap

Parameters
valuenew value

Definition at line 173 of file EcalMatacqDigi.h.

References tv_sec_, and tv_usec_.

173  {
174  tv_sec_ = value.tv_sec;
175  tv_usec_ = value.tv_usec;
176  }
Definition: value.py:1

◆ triggerType() [1/2]

int EcalMatacqDigi::triggerType ( ) const
inline

Gets type of test trigger

Returns
triggerType

Definition at line 151 of file EcalMatacqDigi.h.

References triggerType_.

Referenced by MatacqDataFormatter::interpretRawData().

151 { return triggerType_; }

◆ triggerType() [2/2]

void EcalMatacqDigi::triggerType ( int  value)
inline

Sets type of test trigger

Parameters
valuenew value

Definition at line 156 of file EcalMatacqDigi.h.

References triggerType_, and relativeConstraints::value.

◆ trigRec() [1/2]

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 193 of file EcalMatacqDigi.h.

References trigRec_.

Referenced by MatacqDataFormatter::interpretRawData().

193 { return trigRec_; }

◆ trigRec() [2/2]

void EcalMatacqDigi::trigRec ( int  value)
inline

Sets the Trig Rec value (see Matacq documentation)

Parameters
valuenew value

Definition at line 198 of file EcalMatacqDigi.h.

References trigRec_, and relativeConstraints::value.

◆ ts()

float EcalMatacqDigi::ts ( ) const
inline

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

Definition at line 91 of file EcalMatacqDigi.h.

References ts_.

91 { return ts_; }

◆ tTrig()

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 105 of file EcalMatacqDigi.h.

References tTrigS_.

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

105 { return tTrigS_; }

◆ vernier() [1/2]

std::vector<int> EcalMatacqDigi::vernier ( ) const
inline

Gets the vernier values (see Matacq documentation)

Returns
verniers

Definition at line 213 of file EcalMatacqDigi.h.

References vernier_.

Referenced by MatacqDataFormatter::interpretRawData().

213 { return vernier_; }
std::vector< Int_t > vernier_

◆ vernier() [2/2]

void EcalMatacqDigi::vernier ( const std::vector< int > &  value)
inline

Sets verniers

Parameters
valuenew value

Definition at line 218 of file EcalMatacqDigi.h.

References relativeConstraints::value, and vernier_.

218 { vernier_ = value; }
std::vector< Int_t > vernier_

◆ version()

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 118 of file EcalMatacqDigi.h.

References version_.

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

118 { return version_; }

Member Data Documentation

◆ attenuation_dB_

char EcalMatacqDigi::attenuation_dB_
private

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

Definition at line 324 of file EcalMatacqDigi.h.

Referenced by attenuation_dB(), and init().

◆ bxId_

Short_t EcalMatacqDigi::bxId_
private

Bunch crossing Id

Definition at line 328 of file EcalMatacqDigi.h.

Referenced by bxId(), and init().

◆ chId_

int EcalMatacqDigi::chId_
private

Electronic channel id

Definition at line 297 of file EcalMatacqDigi.h.

Referenced by chId(), and id().

◆ data_

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

ADC count of time samples

Definition at line 301 of file EcalMatacqDigi.h.

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

◆ delayA_

Int_t EcalMatacqDigi::delayA_
private

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

Definition at line 352 of file EcalMatacqDigi.h.

Referenced by delayA(), and init().

◆ emtcDelay_

Int_t EcalMatacqDigi::emtcDelay_
private

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

Definition at line 356 of file EcalMatacqDigi.h.

Referenced by emtcDelay(), and init().

◆ emtcPhase_

Int_t EcalMatacqDigi::emtcPhase_
private

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

Definition at line 360 of file EcalMatacqDigi.h.

Referenced by emtcPhase(), and init().

◆ l1a_

Int_t EcalMatacqDigi::l1a_
private

Event id. Actually LV1 ID.

Definition at line 332 of file EcalMatacqDigi.h.

Referenced by init(), and l1a().

◆ laserPower_

Int_t EcalMatacqDigi::laserPower_
private

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

Definition at line 364 of file EcalMatacqDigi.h.

Referenced by init(), and laserPower().

◆ lsb_

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().

◆ MAXSAMPLES

const int EcalMatacqDigi::MAXSAMPLES = 2560
static

Maximum number of time samples

Definition at line 24 of file EcalMatacqDigi.h.

◆ orbitId_

Int_t EcalMatacqDigi::orbitId_
private

Definition at line 336 of file EcalMatacqDigi.h.

Referenced by init(), and orbitId().

◆ postTrig_

Short_t EcalMatacqDigi::postTrig_
private

Posttrig value (see Matacq documentation)

Definition at line 344 of file EcalMatacqDigi.h.

Referenced by init(), and postTrig().

◆ triggerType_

char EcalMatacqDigi::triggerType_
private

Type of test trigger

Returns
triggerType

Definition at line 319 of file EcalMatacqDigi.h.

Referenced by init(), and triggerType().

◆ trigRec_

Short_t EcalMatacqDigi::trigRec_
private

Trig Rec value (see Matacq documentation)

Definition at line 340 of file EcalMatacqDigi.h.

Referenced by init(), and trigRec().

◆ ts_

double EcalMatacqDigi::ts_
private

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

Definition at line 305 of file EcalMatacqDigi.h.

Referenced by ts().

◆ tTrigS_

double EcalMatacqDigi::tTrigS_
private

Trigger time in seconds

Definition at line 309 of file EcalMatacqDigi.h.

Referenced by tTrig().

◆ tv_sec_

Long64_t EcalMatacqDigi::tv_sec_
private

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

Definition at line 370 of file EcalMatacqDigi.h.

Referenced by init(), and timeStamp().

◆ tv_usec_

Long64_t EcalMatacqDigi::tv_usec_
private

Definition at line 371 of file EcalMatacqDigi.h.

Referenced by init(), and timeStamp().

◆ vernier_

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

Vernier values (see Matacq documentation)

Definition at line 348 of file EcalMatacqDigi.h.

Referenced by init(), and vernier().

◆ version_

short EcalMatacqDigi::version_
private

version of raw data format, the digis originate from.

Definition at line 313 of file EcalMatacqDigi.h.

Referenced by version().