BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
Adc Class Reference

#include <TofData.h>

+ Inheritance diagram for Adc:

Public Member Functions

 Adc ()
 
void setCorr ()
 
void setElec ()
 
void setValue (Identifier identify, int value)
 
double qtc () const
 
- Public Member Functions inherited from TofValue
 TofValue ()
 
virtual ~TofValue ()
 
TofValueoperator= (const TofValue &source)
 
int channel () const
 
int times () const
 
int number () const
 
int clock () const
 
double value () const
 
bool used () const
 
void timespp ()
 
void timesmm ()
 
void setNumber (int number)
 
void setUsed (bool used)
 

Additional Inherited Members

- Protected Attributes inherited from TofValue
int m_clock
 
int m_channel
 
double m_value
 

Detailed Description

Definition at line 43 of file TofData.h.

Constructor & Destructor Documentation

◆ Adc()

Adc::Adc ( )

Definition at line 69 of file TofData.cxx.

69 {
70 m_corr = false;
71 m_elec = false;
72 m_mrpc = false;
73 m_qtc = -999.0;
74}

Member Function Documentation

◆ qtc()

double Adc::qtc ( ) const
inline

Definition at line 52 of file TofData.h.

52{ return m_qtc; }

Referenced by PmtData::adc(), and PmtData::qtc().

◆ setCorr()

void Adc::setCorr ( )
inline

Definition at line 47 of file TofData.h.

47{ m_corr = true; }

Referenced by TofRawDataProvider::tofDataMapFull().

◆ setElec()

void Adc::setElec ( )
inline

Definition at line 48 of file TofData.h.

48{ m_elec = true; }

Referenced by TofRawDataProvider::tofDataMapFull().

◆ setValue()

void Adc::setValue ( Identifier  identify,
int  value 
)

Definition at line 77 of file TofData.cxx.

77 {
78 m_clock = ( ( value & 0x7e000 ) >> 13 );
79 if( value == 0x7fffffff ) {
80 m_clock = 100;
81 m_channel = 10000;
82 m_qtc = 10000.0;
83 m_value = 10000.0;
84 }
85 else if( value == -999 ) {
86 m_channel = -999;
87 m_qtc = -999.0;
88 m_value = -999.0;
89 }
90 else {
91
92 m_mrpc = TofID::is_mrpc( identify );
93 if( m_mrpc ) {
96 }
97 else {
98 if( !( TofID::is_scin( identify ) ) ) {
99 std::cout << "Event/RawDataProviderSvc:: ERROR! ETF(MRPC) data is treated as scintillator data !" << std::endl;
100 }
101
102 m_channel = ( value & 0x1fff );
103 if( ( value & 0x80000 ) != 0 ) {
104 if( m_corr ) {
105 if( m_channel < 4000 ) {
106 m_channel += 0x2000;
107 }
108 }
109 else {
110 m_channel += 0x2000;
111 }
112 }
113
114 int barrel = TofID::barrel_ec( identify );
115 int tofid = TofID::phi_module( identify );
116 int layer = TofID::layer( identify );
117 if( barrel==1 ) {
118 if( layer==1 ) {
119 tofid = tofid + 88;
120 }
121 }
122 else if( barrel==2 ) {
123 tofid = tofid + 48;
124 }
125 int east = TofID::end( identify );
126
127 if( m_corr ) {
128 if( barrel==1 ) {
129 if( east==0 ) {
130 m_qtc = tofQCorrSvc->BQRaw1( tofid, m_channel*1.0 );
131 }
132 else {
133 m_qtc = tofQCorrSvc->BQRaw2( tofid, m_channel*1.0 );
134 }
135 }
136 else {
137 m_qtc = tofQCorrSvc->EQRaw( tofid, m_channel*1.0 );
138 }
139 }
140 else {
141 m_qtc = m_channel*1.0;
142 }
143
144 if( m_elec ) {
145 if( barrel==1 ) {
146 if( east==0 ) {
147 m_value = tofQElecSvc->BQTC1( tofid, m_qtc );
148 }
149 else {
150 m_value = tofQElecSvc->BQTC2( tofid, m_qtc );
151 }
152 }
153 else {
154 m_value = tofQElecSvc->EQTC( tofid, m_qtc );
155 }
156 }
157 else {
158 m_value = m_qtc*1.0;
159 }
160 }
161
162 }
163 return;
164}
ITofQElecSvc * tofQElecSvc
ITofQCorrSvc * tofQCorrSvc
virtual const double BQRaw1(int id, double q)=0
virtual const double EQRaw(int id, double q)=0
virtual const double BQRaw2(int id, double q)=0
virtual const double BQTC2(int id, double q)=0
virtual const double BQTC1(int id, double q)=0
virtual const double EQTC(int id, double q)=0
static double TofTime(unsigned int timeChannel)
Definition: RawDataUtil.h:63
static bool is_scin(const Identifier &id)
Definition: TofID.cxx:102
static int end(const Identifier &id)
Definition: TofID.cxx:79
static bool is_mrpc(const Identifier &id)
Definition: TofID.cxx:113
static int phi_module(const Identifier &id)
Definition: TofID.cxx:73
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: TofID.cxx:61
static int layer(const Identifier &id)
Definition: TofID.cxx:66
double value() const
Definition: TofData.h:21
double m_value
Definition: TofData.h:33
int m_channel
Definition: TofData.h:32
int m_clock
Definition: TofData.h:31

Referenced by TofRawDataProvider::tofDataMapFull().


The documentation for this class was generated from the following files: