CGEM BOSS 6.6.5.f
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 (int value)
 
void setValue_mrpc (int value, int clock)
 
void calculate (bool barrel, int tofid, bool east, int identify)
 
double qtc () const
 
 Adc ()
 
void setCorr ()
 
void setElec ()
 
void setValue (int value)
 
void setValue_mrpc (int value, int clock)
 
void calculate (bool barrel, int tofid, bool east, int identify)
 
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)
 
virtual void setValue (int value)=0
 
void setUsed (bool used)
 
 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)
 
virtual void setValue (int value)=0
 
void setUsed (bool used)
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ Adc() [1/2]

Adc::Adc ( )

Definition at line 68 of file TofData.cxx.

68 {
69 m_corr = false;
70 m_elec = false;
71 m_calculated = false;
72 m_qtc = -999.0;
73}

◆ Adc() [2/2]

Adc::Adc ( )

Member Function Documentation

◆ calculate() [1/2]

void Adc::calculate ( bool  barrel,
int  tofid,
bool  east,
int  identify 
)

Definition at line 122 of file TofData.cxx.

122 {
123
124 Identifier help = TofID::cell_id(identify);
125 bool is_mrpc = TofID::is_mymrpc(help);
126 //std::cout << "TofData Adc::calculate identifier = " << help<<std::endl;
127 //std::cout << "TofData Adc::calculate is_mrpc ? = " << is_mrpc<<std::endl;
128
129 if( m_calculated ) return;
130 //std::cout << "TofData Adc::calculate m_corr= " << m_corr <<std::endl;
131 if( m_corr ) {
132 if( barrel ) {
133 if( east ) {
134 m_qtc = tofQCorrSvc->BQRaw1( tofid, m_channel*1.0 );
135 }
136 else {
137 m_qtc = tofQCorrSvc->BQRaw2( tofid, m_channel*1.0 );
138 }
139 }//close if barrel
140 else {
141 if(is_mrpc==false)
142 { m_qtc = tofQCorrSvc->EQRaw( tofid, m_channel*1.0 );}
143 else
144 {m_qtc = m_channel*1.0;}
145 // std::cout << "TofData Adc::calculate Endcap m_qtc = " << m_corr<<std::endl;
146 }
147 }//close if m_corr
148 else {
149 m_qtc = m_channel*1.0;
150 //std::cout << "TofData Adc::calculate m_qtc = " << m_qtc<<std::endl;
151 }
152 //std::cout << "TofData Adc::calculate m_elec = " << m_elec<<std::endl;
153 if( m_elec ) {
154 if( barrel ) {
155 if( east ) {
156 m_value = tofQElecSvc->BQTC1( tofid, m_qtc );
157 }
158 else {
159 m_value = tofQElecSvc->BQTC2( tofid, m_qtc );
160 }
161 }//close if(barrel)
162 else {
163 if(is_mrpc==false)
164 {m_value = tofQElecSvc->EQTC( tofid, m_qtc );}
165 else
166 {
168 }
169 // std::cout << "TofData Adc::calculate TofID = " << identify <<std::endl;
170 // std::cout << "TofData Adc::calculate TofID = " << tofid<<std::endl;
171 // std::cout << "TofData Adc::calculate Endcap m_value= " << m_value<<std::endl;
172 }
173 }//close if m_elec
174 else {
175 m_value = m_qtc*1.0;
176 // std::cout << "TofData Adc::calculate m_value= " << m_value<<std::endl;
177 }
178 m_calculated = true;
179 return;
180}
std::string help()
Definition: HelloServer.cpp:35
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)
static Identifier cell_id(int barrel_ec, int layer, int phi_module, int end)
For a single crystal.
static bool is_mymrpc(const Identifier &id)

Referenced by PmtData::calculate().

◆ calculate() [2/2]

void Adc::calculate ( bool  barrel,
int  tofid,
bool  east,
int  identify 
)

◆ qtc() [1/2]

double Adc::qtc ( ) const
inline

Definition at line 55 of file Event/RawDataProviderSvc/RawDataProviderSvc-00-03-40/RawDataProviderSvc/TofData.h.

55{ return m_qtc; }

Referenced by PmtData::qtc().

◆ qtc() [2/2]

double Adc::qtc ( ) const
inline

Definition at line 55 of file InstallArea/include/RawDataProviderSvc/RawDataProviderSvc/TofData.h.

55{ return m_qtc; }

◆ setCorr() [1/2]

void Adc::setCorr ( )
inline

◆ setCorr() [2/2]

void Adc::setCorr ( )
inline

Definition at line 47 of file InstallArea/include/RawDataProviderSvc/RawDataProviderSvc/TofData.h.

47{ m_corr = true; }

◆ setElec() [1/2]

void Adc::setElec ( )
inline

◆ setElec() [2/2]

void Adc::setElec ( )
inline

Definition at line 48 of file InstallArea/include/RawDataProviderSvc/RawDataProviderSvc/TofData.h.

48{ m_elec = true; }

◆ setValue() [1/2]

void Adc::setValue ( int  value)
virtual

Implements TofValue.

Definition at line 85 of file TofData.cxx.

85 {
86 m_clock = ( ( value & 0x7e000 ) >> 13 );
87 if( value == 0x7fffffff ) {
88 m_clock = 100;
89 m_channel = 10000;
90 m_qtc = 10000.0;
91 m_value = 10000.0;
92 m_calculated = true;
93 }
94 else if( value == -999 ) {
95 m_channel = -999;
96 m_qtc = -999.0;
97 m_value = -999.0;
98 m_calculated = true;
99 }
100 else {
101 if( m_corr ) {
102 m_channel = ( value & 0x1fff );
103 if( ( ( value & 0x80000 ) != 0 ) && ( m_channel < 4000 ) ) {
104 m_channel += 0x2000;
105 }
106 }
107 else {
108 m_channel = ( value & 0x1fff );
109 //std::cout << "TofData Adc::setValue() m_channel = " << m_channel << std::endl;
110
111 if( ( value & 0x80000 ) != 0 ) {
112 m_channel += 0x2000;
113 //std::cout << "TofData Adc::setValue() ( value & 0x80000 ) != 0 --> m_channel = " << m_channel << std::endl;
114 }
115 }
116 }
117
118 return;
119}

Referenced by TofRawDataProvider::tofDataMapFull().

◆ setValue() [2/2]

void Adc::setValue ( int  value)
virtual

Implements TofValue.

◆ setValue_mrpc() [1/2]

void Adc::setValue_mrpc ( int  value,
int  clock 
)

◆ setValue_mrpc() [2/2]

void Adc::setValue_mrpc ( int  value,
int  clock 
)

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