BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RawDataUtil Class Reference

#include <RawDataUtil.h>

Static Public Member Functions

static double MdcTime (int timeChannel)
static int MdcTimeChannel (double time)
static double MdcCharge (int chargeChannel)
static int MdcChargeChannel (double charge)
static double EmcTime (int timeChannel)
static int EmcTimeChannel (double time)
static double EmcCharge (int measure, int chargeChannel)
static int EmcChargeChannel (double charge)
static int EmcChargeMeasure (double charge)
static double TofTime (unsigned int timeChannel)
static unsigned int TofTimeChannel (double time)
static double TofCharge (unsigned int chargeChannel)
static unsigned int TofChargeChannel (double charge, double time)
static double MdcTime (int timeChannel)
static int MdcTimeChannel (double time)
static double MdcCharge (int chargeChannel)
static int MdcChargeChannel (double charge)
static double EmcTime (int timeChannel)
static int EmcTimeChannel (double time)
static double EmcCharge (int measure, int chargeChannel)
static int EmcChargeChannel (double charge)
static int EmcChargeMeasure (double charge)
static double TofTime (unsigned int timeChannel)
static unsigned int TofTimeChannel (double time)
static double TofCharge (unsigned int chargeChannel)
static unsigned int TofChargeChannel (double charge, double time)
static double MdcTime (int timeChannel)
static int MdcTimeChannel (double time)
static double MdcCharge (int chargeChannel)
static int MdcChargeChannel (double charge)
static double EmcTime (int timeChannel)
static int EmcTimeChannel (double time)
static double EmcCharge (int measure, int chargeChannel)
static int EmcChargeChannel (double charge)
static int EmcChargeMeasure (double charge)
static double TofTime (unsigned int timeChannel)
static unsigned int TofTimeChannel (double time)
static double TofCharge (unsigned int chargeChannel)
static unsigned int TofChargeChannel (double charge, double time)

Detailed Description

Definition at line 5 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

Member Function Documentation

◆ EmcCharge() [1/3]

double RawDataUtil::EmcCharge ( int measure,
int chargeChannel )
inlinestatic

Definition at line 22 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

22 {
23 switch ( measure )
24 {
25 case 3: // saturation of high measure
26 return ( (double)chargeChannel ) * EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR;
27 break;
28 case 2:
29 return ( (double)chargeChannel ) * EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR;
30 break;
31 case 1:
32 return ( (double)chargeChannel ) * EMC_CHARGE_MID_MEASURE / EMC_CHARGE_FACTOR;
33 break;
34 case 0:
35 return ( (double)chargeChannel ) * EMC_CHARGE_LOW_MEASURE / EMC_CHARGE_FACTOR;
36 break;
37 default: std::cerr << "Wrong measure of EMC charge channel!" << std::endl; exit( 1 );
38 }
39 }

Referenced by EmcRawDataProvider::doCalib(), EFGlobalEnergy::execute(), EmcRec::execute(), EmcDigi::operator+=(), and EmcROOTGeo::SetHits().

◆ EmcCharge() [2/3]

double RawDataUtil::EmcCharge ( int measure,
int chargeChannel )
inlinestatic

Definition at line 22 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

22 {
23 switch ( measure )
24 {
25 case 3: // saturation of high measure
26 return ( (double)chargeChannel ) * EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR;
27 break;
28 case 2:
29 return ( (double)chargeChannel ) * EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR;
30 break;
31 case 1:
32 return ( (double)chargeChannel ) * EMC_CHARGE_MID_MEASURE / EMC_CHARGE_FACTOR;
33 break;
34 case 0:
35 return ( (double)chargeChannel ) * EMC_CHARGE_LOW_MEASURE / EMC_CHARGE_FACTOR;
36 break;
37 default: std::cerr << "Wrong measure of EMC charge channel!" << std::endl; exit( 1 );
38 }
39 }

◆ EmcCharge() [3/3]

double RawDataUtil::EmcCharge ( int measure,
int chargeChannel )
inlinestatic

Definition at line 22 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

22 {
23 switch ( measure )
24 {
25 case 3: // saturation of high measure
26 return ( (double)chargeChannel ) * EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR;
27 break;
28 case 2:
29 return ( (double)chargeChannel ) * EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR;
30 break;
31 case 1:
32 return ( (double)chargeChannel ) * EMC_CHARGE_MID_MEASURE / EMC_CHARGE_FACTOR;
33 break;
34 case 0:
35 return ( (double)chargeChannel ) * EMC_CHARGE_LOW_MEASURE / EMC_CHARGE_FACTOR;
36 break;
37 default: std::cerr << "Wrong measure of EMC charge channel!" << std::endl; exit( 1 );
38 }
39 }

◆ EmcChargeChannel() [1/3]

int RawDataUtil::EmcChargeChannel ( double charge)
inlinestatic

Definition at line 41 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

41 {
42 if ( charge > EMC_CHARGE_HIGH_MEASURE ) { return (int)( EMC_CHARGE_FACTOR - 1 ); }
43 else if ( charge > EMC_CHARGE_MID_MEASURE )
44 { return (int)( charge / ( EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR ) ); }
45 else if ( charge > EMC_CHARGE_LOW_MEASURE )
46 { return (int)( charge / ( EMC_CHARGE_MID_MEASURE / EMC_CHARGE_FACTOR ) ); }
47 else { return (int)( charge / ( EMC_CHARGE_LOW_MEASURE / EMC_CHARGE_FACTOR ) ); }
48 }

Referenced by EmcRawDataProvider::doCalib(), RawDataProviderSvc::initialize(), EmcDigi::operator+=(), and BesRawDataWriter::SaveEmcDigits().

◆ EmcChargeChannel() [2/3]

int RawDataUtil::EmcChargeChannel ( double charge)
inlinestatic

Definition at line 41 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

41 {
42 if ( charge > EMC_CHARGE_HIGH_MEASURE ) { return (int)( EMC_CHARGE_FACTOR - 1 ); }
43 else if ( charge > EMC_CHARGE_MID_MEASURE )
44 { return (int)( charge / ( EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR ) ); }
45 else if ( charge > EMC_CHARGE_LOW_MEASURE )
46 { return (int)( charge / ( EMC_CHARGE_MID_MEASURE / EMC_CHARGE_FACTOR ) ); }
47 else { return (int)( charge / ( EMC_CHARGE_LOW_MEASURE / EMC_CHARGE_FACTOR ) ); }
48 }

◆ EmcChargeChannel() [3/3]

int RawDataUtil::EmcChargeChannel ( double charge)
inlinestatic

Definition at line 41 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

41 {
42 if ( charge > EMC_CHARGE_HIGH_MEASURE ) { return (int)( EMC_CHARGE_FACTOR - 1 ); }
43 else if ( charge > EMC_CHARGE_MID_MEASURE )
44 { return (int)( charge / ( EMC_CHARGE_HIGH_MEASURE / EMC_CHARGE_FACTOR ) ); }
45 else if ( charge > EMC_CHARGE_LOW_MEASURE )
46 { return (int)( charge / ( EMC_CHARGE_MID_MEASURE / EMC_CHARGE_FACTOR ) ); }
47 else { return (int)( charge / ( EMC_CHARGE_LOW_MEASURE / EMC_CHARGE_FACTOR ) ); }
48 }

◆ EmcChargeMeasure() [1/3]

int RawDataUtil::EmcChargeMeasure ( double charge)
inlinestatic

Definition at line 50 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

50 {
51 if ( charge > EMC_CHARGE_HIGH_MEASURE ) { return 3; }
52 else if ( charge > EMC_CHARGE_MID_MEASURE ) { return 2; }
53 else if ( charge > EMC_CHARGE_LOW_MEASURE ) { return 1; }
54 else { return 0; }
55 }

Referenced by EmcRawDataProvider::doCalib(), EmcDigi::operator+=(), and BesRawDataWriter::SaveEmcDigits().

◆ EmcChargeMeasure() [2/3]

int RawDataUtil::EmcChargeMeasure ( double charge)
inlinestatic

Definition at line 50 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

50 {
51 if ( charge > EMC_CHARGE_HIGH_MEASURE ) { return 3; }
52 else if ( charge > EMC_CHARGE_MID_MEASURE ) { return 2; }
53 else if ( charge > EMC_CHARGE_LOW_MEASURE ) { return 1; }
54 else { return 0; }
55 }

◆ EmcChargeMeasure() [3/3]

int RawDataUtil::EmcChargeMeasure ( double charge)
inlinestatic

Definition at line 50 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

50 {
51 if ( charge > EMC_CHARGE_HIGH_MEASURE ) { return 3; }
52 else if ( charge > EMC_CHARGE_MID_MEASURE ) { return 2; }
53 else if ( charge > EMC_CHARGE_LOW_MEASURE ) { return 1; }
54 else { return 0; }
55 }

◆ EmcTime() [1/3]

double RawDataUtil::EmcTime ( int timeChannel)
inlinestatic

Definition at line 17 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

17 {
18 return ( (double)timeChannel ) / EMC_TIME_FACTOR;
19 }

Referenced by EmcRec::execute(), EmcDigi::operator+=(), and EmcROOTGeo::SetHits().

◆ EmcTime() [2/3]

double RawDataUtil::EmcTime ( int timeChannel)
inlinestatic

Definition at line 17 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

17 {
18 return ( (double)timeChannel ) / EMC_TIME_FACTOR;
19 }

◆ EmcTime() [3/3]

double RawDataUtil::EmcTime ( int timeChannel)
inlinestatic

Definition at line 17 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

17 {
18 return ( (double)timeChannel ) / EMC_TIME_FACTOR;
19 }

◆ EmcTimeChannel() [1/3]

int RawDataUtil::EmcTimeChannel ( double time)
inlinestatic

Definition at line 20 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

20{ return (int)( time * EMC_TIME_FACTOR ); }
Double_t time

Referenced by EmcDigi::operator+=(), and BesRawDataWriter::SaveEmcDigits().

◆ EmcTimeChannel() [2/3]

int RawDataUtil::EmcTimeChannel ( double time)
inlinestatic

Definition at line 20 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

20{ return (int)( time * EMC_TIME_FACTOR ); }

◆ EmcTimeChannel() [3/3]

int RawDataUtil::EmcTimeChannel ( double time)
inlinestatic

Definition at line 20 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

20{ return (int)( time * EMC_TIME_FACTOR ); }

◆ MdcCharge() [1/3]

double RawDataUtil::MdcCharge ( int chargeChannel)
inlinestatic

◆ MdcCharge() [2/3]

double RawDataUtil::MdcCharge ( int chargeChannel)
inlinestatic

Definition at line 12 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

12 {
13 return ( (double)chargeChannel ) * MDC_CHARGE_FACTOR;
14 }

◆ MdcCharge() [3/3]

double RawDataUtil::MdcCharge ( int chargeChannel)
inlinestatic

Definition at line 12 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

12 {
13 return ( (double)chargeChannel ) * MDC_CHARGE_FACTOR;
14 }

◆ MdcChargeChannel() [1/3]

int RawDataUtil::MdcChargeChannel ( double charge)
inlinestatic

Definition at line 15 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

15{ return (int)( charge / MDC_CHARGE_FACTOR ); }

Referenced by BesRawDataWriter::SaveMdcDigits().

◆ MdcChargeChannel() [2/3]

int RawDataUtil::MdcChargeChannel ( double charge)
inlinestatic

Definition at line 15 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

15{ return (int)( charge / MDC_CHARGE_FACTOR ); }

◆ MdcChargeChannel() [3/3]

int RawDataUtil::MdcChargeChannel ( double charge)
inlinestatic

Definition at line 15 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

15{ return (int)( charge / MDC_CHARGE_FACTOR ); }

◆ MdcTime() [1/3]

◆ MdcTime() [2/3]

double RawDataUtil::MdcTime ( int timeChannel)
inlinestatic

Definition at line 7 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

7 {
8 return ( (double)timeChannel ) * MDC_TIME_FACTOR;
9 }

◆ MdcTime() [3/3]

double RawDataUtil::MdcTime ( int timeChannel)
inlinestatic

Definition at line 7 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

7 {
8 return ( (double)timeChannel ) * MDC_TIME_FACTOR;
9 }

◆ MdcTimeChannel() [1/3]

int RawDataUtil::MdcTimeChannel ( double time)
inlinestatic

Definition at line 10 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

10{ return (int)( time / MDC_TIME_FACTOR ); }

Referenced by BesRawDataWriter::SaveMdcDigits().

◆ MdcTimeChannel() [2/3]

int RawDataUtil::MdcTimeChannel ( double time)
inlinestatic

Definition at line 10 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

10{ return (int)( time / MDC_TIME_FACTOR ); }

◆ MdcTimeChannel() [3/3]

int RawDataUtil::MdcTimeChannel ( double time)
inlinestatic

Definition at line 10 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

10{ return (int)( time / MDC_TIME_FACTOR ); }

◆ TofCharge() [1/3]

double RawDataUtil::TofCharge ( unsigned int chargeChannel)
inlinestatic

Definition at line 64 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

64 {
65 double ADC = chargeChannel & 0x1fff;
66 return ADC * TOF_CHARGE_FACTOR;
67 }

Referenced by EmcRecTofDigitCalib::Convert().

◆ TofCharge() [2/3]

double RawDataUtil::TofCharge ( unsigned int chargeChannel)
inlinestatic

Definition at line 64 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

64 {
65 double ADC = chargeChannel & 0x1fff;
66 return ADC * TOF_CHARGE_FACTOR;
67 }

◆ TofCharge() [3/3]

double RawDataUtil::TofCharge ( unsigned int chargeChannel)
inlinestatic

Definition at line 64 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

64 {
65 double ADC = chargeChannel & 0x1fff;
66 return ADC * TOF_CHARGE_FACTOR;
67 }

◆ TofChargeChannel() [1/3]

unsigned int RawDataUtil::TofChargeChannel ( double charge,
double time )
inlinestatic

Definition at line 69 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

69 {
70 unsigned int ADC = (unsigned)( charge / TOF_CHARGE_FACTOR );
71 unsigned int TDC = (unsigned)( time / TOF_TIME_FACTOR );
72 if ( ADC >= 8192 )
73 {
74 ADC = ( ADC | 0x080000 ); // if ADC_channel>=8192, set overflow flag = 1.
75 // The overlow flag is the 20th bit of the ADC_channel.
76 }
77 ADC = ( ( TDC & 0x07e000 ) | ADC ); // Store tclock into ADC_channel as qclock
78 // std::cout<<"ADC: "<<ADC<<std::endl;
79 // std::cout<<"TDC: "<<TDC<<std::endl;
80 // std::cout<<"qclock: "<<( ( ADC & 0x7e000 ) >> 13 );
81 // std::cout<<" tclock: "<<( ( TDC & 0x7e000 ) >> 13 )<<std::endl;
82 // if ( ( ( ADC & 0x7e000 ) >> 13 ) != (( TDC & 0x7e000 ) >> 13 ) )
83 // std::cout<<"qclock!=tclock"<<std::endl;
84 return ADC;
85 }

◆ TofChargeChannel() [2/3]

unsigned int RawDataUtil::TofChargeChannel ( double charge,
double time )
inlinestatic

Definition at line 69 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

69 {
70 unsigned int ADC = (unsigned)( charge / TOF_CHARGE_FACTOR );
71 unsigned int TDC = (unsigned)( time / TOF_TIME_FACTOR );
72 if ( ADC >= 8192 )
73 {
74 ADC = ( ADC | 0x080000 ); // if ADC_channel>=8192, set overflow flag = 1.
75 // The overlow flag is the 20th bit of the ADC_channel.
76 }
77 ADC = ( ( TDC & 0x07e000 ) | ADC ); // Store tclock into ADC_channel as qclock
78 // std::cout<<"ADC: "<<ADC<<std::endl;
79 // std::cout<<"TDC: "<<TDC<<std::endl;
80 // std::cout<<"qclock: "<<( ( ADC & 0x7e000 ) >> 13 );
81 // std::cout<<" tclock: "<<( ( TDC & 0x7e000 ) >> 13 )<<std::endl;
82 // if ( ( ( ADC & 0x7e000 ) >> 13 ) != (( TDC & 0x7e000 ) >> 13 ) )
83 // std::cout<<"qclock!=tclock"<<std::endl;
84 return ADC;
85 }

◆ TofChargeChannel() [3/3]

unsigned int RawDataUtil::TofChargeChannel ( double charge,
double time )
inlinestatic

Definition at line 69 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

69 {
70 unsigned int ADC = (unsigned)( charge / TOF_CHARGE_FACTOR );
71 unsigned int TDC = (unsigned)( time / TOF_TIME_FACTOR );
72 if ( ADC >= 8192 )
73 {
74 ADC = ( ADC | 0x080000 ); // if ADC_channel>=8192, set overflow flag = 1.
75 // The overlow flag is the 20th bit of the ADC_channel.
76 }
77 ADC = ( ( TDC & 0x07e000 ) | ADC ); // Store tclock into ADC_channel as qclock
78 // std::cout<<"ADC: "<<ADC<<std::endl;
79 // std::cout<<"TDC: "<<TDC<<std::endl;
80 // std::cout<<"qclock: "<<( ( ADC & 0x7e000 ) >> 13 );
81 // std::cout<<" tclock: "<<( ( TDC & 0x7e000 ) >> 13 )<<std::endl;
82 // if ( ( ( ADC & 0x7e000 ) >> 13 ) != (( TDC & 0x7e000 ) >> 13 ) )
83 // std::cout<<"qclock!=tclock"<<std::endl;
84 return ADC;
85 }

◆ TofTime() [1/3]

double RawDataUtil::TofTime ( unsigned int timeChannel)
inlinestatic

Definition at line 57 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

57 {
58 return ( (double)timeChannel ) * TOF_TIME_FACTOR;
59 }

Referenced by EmcRecTofDigitCalib::Convert(), EsTimeAlg::execute(), Adc::setValue(), and Tdc::setValue().

◆ TofTime() [2/3]

double RawDataUtil::TofTime ( unsigned int timeChannel)
inlinestatic

Definition at line 57 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

57 {
58 return ( (double)timeChannel ) * TOF_TIME_FACTOR;
59 }

◆ TofTime() [3/3]

double RawDataUtil::TofTime ( unsigned int timeChannel)
inlinestatic

Definition at line 57 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

57 {
58 return ( (double)timeChannel ) * TOF_TIME_FACTOR;
59 }

◆ TofTimeChannel() [1/3]

unsigned int RawDataUtil::TofTimeChannel ( double time)
inlinestatic

Definition at line 60 of file Event/RawEvent/include/RawEvent/RawDataUtil.h.

60 {
61 return (unsigned int)( time / TOF_TIME_FACTOR );
62 }

Referenced by BesRawDataWriter::SaveTofDigits().

◆ TofTimeChannel() [2/3]

unsigned int RawDataUtil::TofTimeChannel ( double time)
inlinestatic

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawEvent/RawDataUtil.h.

60 {
61 return (unsigned int)( time / TOF_TIME_FACTOR );
62 }

◆ TofTimeChannel() [3/3]

unsigned int RawDataUtil::TofTimeChannel ( double time)
inlinestatic

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-opt/include/RawEvent/RawDataUtil.h.

60 {
61 return (unsigned int)( time / TOF_TIME_FACTOR );
62 }

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