#include <RawDataUtil.h>
Static Public Member Functions | |
double | EmcCharge (int measure, int chargeChannel) |
double | EmcCharge (int measure, int chargeChannel) |
int | EmcChargeChannel (double charge) |
int | EmcChargeChannel (double charge) |
int | EmcChargeMeasure (double charge) |
int | EmcChargeMeasure (double charge) |
double | EmcTime (int timeChannel) |
double | EmcTime (int timeChannel) |
int | EmcTimeChannel (double time) |
int | EmcTimeChannel (double time) |
double | MdcCharge (int chargeChannel) |
double | MdcCharge (int chargeChannel) |
int | MdcChargeChannel (double charge) |
int | MdcChargeChannel (double charge) |
double | MdcTime (int timeChannel) |
double | MdcTime (int timeChannel) |
int | MdcTimeChannel (double time) |
int | MdcTimeChannel (double time) |
double | TofCharge (unsigned int chargeChannel) |
double | TofCharge (unsigned int chargeChannel) |
unsigned int | TofChargeChannel (double charge, double time) |
unsigned int | TofChargeChannel (double charge, double time) |
double | TofTime (unsigned int timeChannel) |
double | TofTime (unsigned int timeChannel) |
unsigned int | TofTimeChannel (double time) |
unsigned int | TofTimeChannel (double time) |
Static Private Attributes | |
const double | EMC_CHARGE_FACTOR = 1024 |
const double | EMC_CHARGE_HIGH_MEASURE = 2500. |
const double | EMC_CHARGE_LOW_MEASURE = 78. |
const double | EMC_CHARGE_MID_MEASURE = 625. |
const double | EMC_TIME_FACTOR = 1 |
const double | MDC_CHARGE_FACTOR = 1. |
const double | MDC_TIME_FACTOR = 0.09375 |
const double | TOF_CHARGE_FACTOR = 0.3 |
const double | TOF_TIME_FACTOR = 0.00293 |
|
00018 { 00019 switch(measure) { 00020 case 3: //saturation of high measure 00021 return ((double)chargeChannel)*EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR; 00022 break; 00023 case 2: 00024 return ((double)chargeChannel)*EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR; 00025 break; 00026 case 1: 00027 return ((double)chargeChannel)*EMC_CHARGE_MID_MEASURE/EMC_CHARGE_FACTOR; 00028 break; 00029 case 0: 00030 return ((double)chargeChannel)*EMC_CHARGE_LOW_MEASURE/EMC_CHARGE_FACTOR; 00031 break; 00032 default: 00033 std::cout<<"Wrong measure of EMC charge channel!"<<std::endl; 00034 } 00035 }
|
|
00018 { 00019 switch(measure) { 00020 case 3: //saturation of high measure 00021 return ((double)chargeChannel)*EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR; 00022 break; 00023 case 2: 00024 return ((double)chargeChannel)*EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR; 00025 break; 00026 case 1: 00027 return ((double)chargeChannel)*EMC_CHARGE_MID_MEASURE/EMC_CHARGE_FACTOR; 00028 break; 00029 case 0: 00030 return ((double)chargeChannel)*EMC_CHARGE_LOW_MEASURE/EMC_CHARGE_FACTOR; 00031 break; 00032 default: 00033 std::cout<<"Wrong measure of EMC charge channel!"<<std::endl; 00034 } 00035 }
|
|
00038 { 00039 if(charge>EMC_CHARGE_HIGH_MEASURE) { 00040 return (int)(EMC_CHARGE_FACTOR-1); 00041 } else if(charge>EMC_CHARGE_MID_MEASURE) { 00042 return (int)(charge/(EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR)); 00043 } else if(charge>EMC_CHARGE_LOW_MEASURE) { 00044 return (int)(charge/(EMC_CHARGE_MID_MEASURE/EMC_CHARGE_FACTOR)); 00045 } else { 00046 return (int)(charge/(EMC_CHARGE_LOW_MEASURE/EMC_CHARGE_FACTOR)); 00047 } 00048 }
|
|
00038 { 00039 if(charge>EMC_CHARGE_HIGH_MEASURE) { 00040 return (int)(EMC_CHARGE_FACTOR-1); 00041 } else if(charge>EMC_CHARGE_MID_MEASURE) { 00042 return (int)(charge/(EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR)); 00043 } else if(charge>EMC_CHARGE_LOW_MEASURE) { 00044 return (int)(charge/(EMC_CHARGE_MID_MEASURE/EMC_CHARGE_FACTOR)); 00045 } else { 00046 return (int)(charge/(EMC_CHARGE_LOW_MEASURE/EMC_CHARGE_FACTOR)); 00047 } 00048 }
|
|
00051 { 00052 if(charge>EMC_CHARGE_HIGH_MEASURE) { 00053 return 3; 00054 } else if(charge>EMC_CHARGE_MID_MEASURE) { 00055 return 2; 00056 } else if(charge>EMC_CHARGE_LOW_MEASURE) { 00057 return 1; 00058 } else { 00059 return 0; 00060 } 00061 }
|
|
00051 { 00052 if(charge>EMC_CHARGE_HIGH_MEASURE) { 00053 return 3; 00054 } else if(charge>EMC_CHARGE_MID_MEASURE) { 00055 return 2; 00056 } else if(charge>EMC_CHARGE_LOW_MEASURE) { 00057 return 1; 00058 } else { 00059 return 0; 00060 } 00061 }
|
|
00014 { return ((double)timeChannel)/EMC_TIME_FACTOR; }
|
|
00014 { return ((double)timeChannel)/EMC_TIME_FACTOR; }
|
|
00015 { return (int)(time*EMC_TIME_FACTOR); }
|
|
00015 { return (int)(time*EMC_TIME_FACTOR); }
|
|
00011 { return ((double)chargeChannel)*MDC_CHARGE_FACTOR; }
|
|
00011 { return ((double)chargeChannel)*MDC_CHARGE_FACTOR; }
|
|
00012 { return (int)(charge/MDC_CHARGE_FACTOR); }
|
|
00012 { return (int)(charge/MDC_CHARGE_FACTOR); }
|
|
00008 { return ((double)timeChannel)*MDC_TIME_FACTOR; }
|
|
00008 { return ((double)timeChannel)*MDC_TIME_FACTOR; }
|
|
00009 { return (int)(time/MDC_TIME_FACTOR); }
|
|
00009 { return (int)(time/MDC_TIME_FACTOR); }
|
|
00067 { 00068 double ADC = chargeChannel & 0x1fff ; 00069 return ADC*TOF_CHARGE_FACTOR; 00070 }
|
|
00067 { 00068 double ADC = chargeChannel & 0x1fff ; 00069 return ADC*TOF_CHARGE_FACTOR; 00070 }
|
|
00073 { 00074 unsigned int ADC = (unsigned) (charge/TOF_CHARGE_FACTOR); 00075 unsigned int TDC = (unsigned) (time/TOF_TIME_FACTOR); 00076 if(ADC>=8192) 00077 { 00078 ADC = (ADC | 0x080000); // if ADC_channel>=8192, set overflow flag = 1. 00079 // The overlow flag is the 20th bit of the ADC_channel. 00080 } 00081 ADC = ( (TDC & 0x07e000) | ADC) ; // Store tclock into ADC_channel as qclock 00082 //std::cout<<"ADC: "<<ADC<<std::endl; 00083 //std::cout<<"TDC: "<<TDC<<std::endl; 00084 //std::cout<<"qclock: "<<( ( ADC & 0x7e000 ) >> 13 ); 00085 //std::cout<<" tclock: "<<( ( TDC & 0x7e000 ) >> 13 )<<std::endl; 00086 //if ( ( ( ADC & 0x7e000 ) >> 13 ) != (( TDC & 0x7e000 ) >> 13 ) ) 00087 // std::cout<<"qclock!=tclock"<<std::endl; 00088 return ADC; 00089 }
|
|
00073 { 00074 unsigned int ADC = (unsigned) (charge/TOF_CHARGE_FACTOR); 00075 unsigned int TDC = (unsigned) (time/TOF_TIME_FACTOR); 00076 if(ADC>=8192) 00077 { 00078 ADC = (ADC | 0x080000); // if ADC_channel>=8192, set overflow flag = 1. 00079 // The overlow flag is the 20th bit of the ADC_channel. 00080 } 00081 ADC = ( (TDC & 0x07e000) | ADC) ; // Store tclock into ADC_channel as qclock 00082 //std::cout<<"ADC: "<<ADC<<std::endl; 00083 //std::cout<<"TDC: "<<TDC<<std::endl; 00084 //std::cout<<"qclock: "<<( ( ADC & 0x7e000 ) >> 13 ); 00085 //std::cout<<" tclock: "<<( ( TDC & 0x7e000 ) >> 13 )<<std::endl; 00086 //if ( ( ( ADC & 0x7e000 ) >> 13 ) != (( TDC & 0x7e000 ) >> 13 ) ) 00087 // std::cout<<"qclock!=tclock"<<std::endl; 00088 return ADC; 00089 }
|
|
00063 { return ((double)timeChannel)*TOF_TIME_FACTOR; }
|
|
00063 { return ((double)timeChannel)*TOF_TIME_FACTOR; }
|
|
00064 { return (unsigned int)(time/TOF_TIME_FACTOR); }
|
|
00064 { return (unsigned int)(time/TOF_TIME_FACTOR); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|