9#ifndef SVD_TRANSPARENT_DIGIT_H
10#define SVD_TRANSPARENT_DIGIT_H
15#include <vxd/dataobjects/VxdID.h>
17#include <framework/datastore/RelationsObject.h>
53 const unsigned short fadcID,
54 const unsigned short apvID,
55 const unsigned short nSample = 0,
56 const short** adc =
nullptr,
57 const short* cmc1 =
nullptr,
58 const short* cmc2 =
nullptr,
59 const short** corradc =
nullptr,
60 const short** fine_cmc1 =
nullptr,
61 const short** fine_cmc2 =
nullptr,
62 const short** fine_corradc =
nullptr)
67 for (
int channel = 0; channel < 128; channel++) {
69 for (
int index = 0; index < 6; index++) {
70 m_ADC[channel][index] = adc[channel][index];
77 if (cmc1 !=
nullptr) {
79 for (
int index = 0; index < 6; index++) {
80 m_cmc1[index] = cmc1[index];
86 if (cmc2 !=
nullptr) {
88 for (
int index = 0; index < 6; index++) {
89 m_cmc2[index] = cmc2[index];
95 if (corradc !=
nullptr) {
96 for (
int channel = 0; channel < 128; channel++) {
98 for (
int index = 0; index < 6; index++) {
99 m_corrADC[channel][index] = corradc[channel][index];
106 if (fine_cmc1 !=
nullptr) {
107 for (
int channel = 0; channel < 128; channel++) {
109 for (
int index = 0; index < 6; index++) {
110 m_fine_cmc1[channel][index] = fine_cmc1[channel][index];
117 if (fine_cmc2 !=
nullptr) {
118 for (
int channel = 0; channel < 128; channel++) {
120 for (
int index = 0; index < 6; index++) {
121 m_fine_cmc2[channel][index] = fine_cmc2[channel][index];
128 if (fine_corradc !=
nullptr) {
129 for (
int channel = 0; channel < 128; channel++) {
131 for (
int index = 0; index < 6; index++) {
177 if (channel < 0 || 128 <= channel)
return nullptr;
178 else return m_ADC[channel];
184 short getADC(
short channel,
short index)
const
187 if (index < 0 || 6 <= index)
return -9999;
188 if (channel < 0 || 128 <= channel)
return -9999;
189 return m_ADC[channel][index];
202 if (index < 0 || 6 <= index)
return -9999;
215 if (index < 0 || 6 <= index)
return -9999;
228 if (index < 0 || 6 <= index)
return -9999;
229 return m_cmc[index] ;
237 if (channel < 0 || 128 <= channel)
return nullptr;
246 if (index < 0 || 6 <= index)
return -9999;
247 if (channel < 0 || 128 <= channel)
return -9999;
255 if (channel < 0 || 128 <= channel)
return nullptr;
264 if (index < 0 || 6 <= index)
return -9999;
265 if (channel < 0 || 128 <= channel)
return -9999;
273 if (channel < 0 || 128 <= channel)
return nullptr;
282 if (index < 0 || 6 <= index)
return -9999;
283 if (channel < 0 || 128 <= channel)
return -9999;
292 if (channel < 0 || 128 <= channel)
return nullptr;
301 if (index < 0 || 6 <= index)
return -9999;
302 if (channel < 0 || 128 <= channel)
return -9999;
311 if (channel < 0 || 128 <= channel)
return nullptr;
320 if (index < 0 || 6 <= index)
return -9999;
321 if (channel < 0 || 128 <= channel)
return -9999;
350 if (adc !=
nullptr) {
351 for (
int channel = 0; channel < 128; channel++) {
353 for (
int index = 0; index < 6; index++) {
354 m_ADC[channel][index] = adc[channel][index];
363 if (adc !=
nullptr) {
365 for (
int index = 0; index < 6; index++) {
366 m_ADC[channel][index] = adc[index];
372 void setADC(
short adc,
short channel,
short index)
374 if (0 <= index && index < 6 && 0 <= channel && channel < 128)
375 m_ADC[channel][index] = adc;
382 for (
int index = 0; index < 6; index++) {
383 m_cmc1[index] = cmc1[index];
391 if (0 <= index && index < 6)
m_cmc1[index] = cmc1;
398 for (
int index = 0; index < 6; index++) {
399 m_cmc2[index] = cmc2[index];
406 if (0 <= index && index < 6)
m_cmc2[index] = cmc2;
413 for (
int index = 0; index < 6; index++) {
414 m_cmc[index] = cmc[index];
421 if (0 <= index && index < 6)
m_cmc[index] = cmc;
428 if (fine_cmc1 !=
nullptr) {
429 for (
int channel = 0; channel < 128; channel++) {
431 for (
int index = 0; index < 6; index++) {
432 m_fine_cmc1[channel][index] = fine_cmc1[channel][index];
441 if (fine_cmc1 !=
nullptr) {
443 for (
int index = 0; index < 6; index++) {
452 if (0 <= index && index < 6 && 0 <= channel && channel < 128)
460 if (fine_cmc2 !=
nullptr) {
461 for (
int channel = 0; channel < 128; channel++) {
463 for (
int index = 0; index < 6; index++) {
464 m_fine_cmc2[channel][index] = fine_cmc2[channel][index];
473 if (fine_cmc2 !=
nullptr) {
475 for (
int index = 0; index < 6; index++) {
484 if (0 <= index && index < 6 && 0 <= channel && channel < 128)
492 if (fine_cmc !=
nullptr) {
493 for (
int channel = 0; channel < 128; channel++) {
495 for (
int index = 0; index < 6; index++) {
496 m_fine_cmc[channel][index] = fine_cmc[channel][index];
505 if (fine_cmc !=
nullptr) {
507 for (
int index = 0; index < 6; index++) {
516 if (0 <= index && index < 6 && 0 <= channel && channel < 128)
524 if (corradc !=
nullptr) {
525 for (
int channel = 0; channel < 128; channel++) {
527 for (
int index = 0; index < 6; index++) {
528 m_corrADC[channel][index] = corradc[channel][index];
537 if (corradc !=
nullptr) {
539 for (
int index = 0; index < 6; index++) {
540 m_corrADC[channel][index] = corradc[index];
548 if (0 <= index && index < 6 && 0 <= channel && channel < 128)
556 if (corradc !=
nullptr) {
557 for (
int channel = 0; channel < 128; channel++) {
559 for (
int index = 0; index < 6; index++) {
569 if (corradc !=
nullptr) {
571 for (
int index = 0; index < 6; index++) {
580 if (0 <= index && index < 6 && 0 <= channel && channel < 128)
595 std::ostringstream os;
597 os <<
"Sensor ID : " <<
m_sensorID <<
", (VXD ID: " <<
id <<
")" << std::endl;
598 os <<
"(layer: " << layer <<
", ladder: " << ladder
599 <<
", sensor: " << sensor <<
", segment: " << segment <<
")"
602 os <<
"Strip side : U" << std::endl;
604 os <<
"Strip side : V" << std::endl;
Defines interface for accessing relations of objects in StoreArray.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
short m_fine_cmc[128][6]
Channel-dependent total common-mode correction values.
unsigned short m_apvID
APV25 ID.
void setFadcID(unsigned short fadcID)
Set FADC ID.
void setFineCMC(short **fine_cmc)
Set CMC values.
unsigned short getFadcID() const
Get FADC ID.
void setADC(short adc, short channel, short index)
Set ADC values.
void setFineCMC2(short *fine_cmc2, short channel)
Set channel-dependent 2nd CMC values.
unsigned short m_nSample
Number of samples.
void setNSample(unsigned short nSample)
Set number of samples.
short m_cmc2[6]
2nd common-mode correction values.
SVDTransparentDigit(const VxdID sensorID, const bool isU, const unsigned short fadcID, const unsigned short apvID, const unsigned short nSample=0, const short **adc=nullptr, const short *cmc1=nullptr, const short *cmc2=nullptr, const short **corradc=nullptr, const short **fine_cmc1=nullptr, const short **fine_cmc2=nullptr, const short **fine_corradc=nullptr)
Useful Constructor.
bool m_isU
True if U, false if V.
SVDTransparentDigit()
Default constructor for the ROOT IO.
void setFineCorrADC(short *corradc, short channel)
Set precisely corrected ADC values.
void setFineCorrADC(short corradc, short channel, short index)
Set precisely corrected ADC values.
void setCorrADC(short *corradc, short channel)
Set corrected ADC values.
void setFineCMC2(short **fine_cmc2)
Set channel-dependent 2nd CMC values.
unsigned short m_sensorID
Compressed sensor identifier.
short m_fine_cmc1[128][6]
Channel-dependent 1st common-mode correction values.
unsigned short m_fadcID
FADC ID.
void setFineCorrADC(short **corradc)
Set precisely corrected ADC values.
void setFineCMC2(short fine_cmc2, short channel, short index)
Set channel-dependent 2nd CMC values.
void setCMC(short cmc, int index)
Set Total commom-mode correction value.
short getFineCMC(short channel, short index) const
Get total fine commom-mode correction value.
void setCMC2(short *cmc2)
Set 2nd commom-mode correction value.
void setCMC1(short cmc1, int index)
Set 1st commom-mode correction value.
short m_corrADC[128][6]
ADC values of strip signal corrected by pedestal and commom-mode.
short getFineCMC1(short channel, short index) const
Get 1st fine commom-mode correction value.
void setFineCMC1(short **fine_cmc1)
Set channel-dependent 1st CMC values.
const short * getCorrADC(short channel) const
Get corrected ADC value with pedestal and common-mode.
const short * getCMC() const
Get total commom-mode correction value.
void setCorrADC(short **corradc)
Set corrected ADC values.
const short * getCMC1() const
Get 1st commom-mode correction value.
const short * getFineCMC1(short channel) const
Get 1st fine commom-mode correction value.
short getCMC2(short index) const
Get 2nd commom-mode correction value.
unsigned short getNSample() const
Get number of samples.
const short * getFineCMC2(short channel) const
Get 2nd fine commom-mode correction value.
const short * getFineCMC(short channel) const
Get total fine commom-mode correction value.
short getFineCorrADC(short channel, short index) const
Get precisely corrected ADC value with pedestal and fine common-mode.
void setFineCMC1(short fine_cmc1, short channel, short index)
Set channel-dependent 1st CMC values.
void setUStrip(bool isu)
Set strip direction.
void setCorrADC(short corradc, short channel, short index)
Set corrected ADC values.
short getCorrADC(short channel, short index) const
Get corrected ADC value with pedestal and common-mode.
std::string print()
Display main parameters in this object.
short m_fine_corrADC[128][6]
ADC values of strip signal precisely corrected by pedestal and fine commom-mode.
void setCMC1(short *cmc1)
Set 1st commom-mode correction value.
void setSensorID(VxdID vxdid)
Set the sensor ID.
VxdID getSensorID() const
Get the sensor ID.
void setFineCMC(short fine_cmc, short channel, short index)
Set channel-dependent CMC values.
short getCMC(short index) const
Get total commom-mode correction value.
void setFineCMC1(short *fine_cmc1, short channel)
Set channel-dependent 1st CMC values.
void setApvID(unsigned short apvID)
Set APV ID.
short getCMC1(short index) const
Get 1st commom-mode correction value.
bool isUStrip() const
Get strip direction.
short m_ADC[128][6]
ADC values of strip signal.
short getFineCMC2(short channel, short index) const
Get 2nd fine commom-mode correction value.
void setFineCMC(short *fine_cmc, short channel)
Set channel-dependent CMC values.
void setADC(short *adc, short channel)
Set ADC values.
unsigned short getApvID() const
Get APV ID.
void setCMC2(short cmc2, int index)
Set 2nd commom-mode correction value.
short m_cmc1[6]
1st common-mode correction values.
void setADC(short **adc)
Set ADC values.
const short * getADC(short channel) const
Get ADC value.
short m_fine_cmc2[128][6]
Channel-dependent 2nd common-mode correction values.
short getADC(short channel, short index) const
Get ADC value.
short m_cmc[6]
total common-mode correction values.
const short * getFineCorrADC(short channel) const
Get precisely corrected ADC value with pedestal and fine common-mode.
const short * getCMC2() const
Get 2nd commom-mode correction value.
void setCMC(short *cmc)
Set Total commom-mode correction value.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getID() const
Get the unique id.
baseType getSensorNumber() const
Get the sensor id.
baseType getSegmentNumber() const
Get the sensor segment.
unsigned short baseType
The base integer type for VxdID.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
Abstract base class for different kinds of events.