8 static double MdcTime(
int timeChannel) {
return ((
double)timeChannel)*MDC_TIME_FACTOR; }
9 static int MdcTimeChannel (
double time) {
return (
int)(time/MDC_TIME_FACTOR); }
11 static double MdcCharge(
int chargeChannel) {
return ((
double)chargeChannel)*MDC_CHARGE_FACTOR; }
14 static double EmcTime(
int timeChannel) {
return ((
double)timeChannel)/EMC_TIME_FACTOR; }
15 static int EmcTimeChannel (
double time) {
return (
int)(time*EMC_TIME_FACTOR); }
17 static double EmcCharge(
int measure,
int chargeChannel)
21 return ((
double)chargeChannel)*EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR;
24 return ((
double)chargeChannel)*EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR;
27 return ((
double)chargeChannel)*EMC_CHARGE_MID_MEASURE/EMC_CHARGE_FACTOR;
30 return ((
double)chargeChannel)*EMC_CHARGE_LOW_MEASURE/EMC_CHARGE_FACTOR;
33 std::cout<<
"Wrong measure of EMC charge channel!"<<std::endl;
39 if(
charge>EMC_CHARGE_HIGH_MEASURE) {
40 return (
int)(EMC_CHARGE_FACTOR-1);
41 }
else if(
charge>EMC_CHARGE_MID_MEASURE) {
42 return (
int)(
charge/(EMC_CHARGE_HIGH_MEASURE/EMC_CHARGE_FACTOR));
43 }
else if(
charge>EMC_CHARGE_LOW_MEASURE) {
44 return (
int)(
charge/(EMC_CHARGE_MID_MEASURE/EMC_CHARGE_FACTOR));
46 return (
int)(
charge/(EMC_CHARGE_LOW_MEASURE/EMC_CHARGE_FACTOR));
52 if(
charge>EMC_CHARGE_HIGH_MEASURE) {
54 }
else if(
charge>EMC_CHARGE_MID_MEASURE) {
56 }
else if(
charge>EMC_CHARGE_LOW_MEASURE) {
63 static double TofTime(
unsigned int timeChannel) {
return ((
double)timeChannel)*TOF_TIME_FACTOR; }
64 static unsigned int TofTimeChannel (
double time) {
return (
unsigned int)(time/TOF_TIME_FACTOR); }
68 double ADC = chargeChannel & 0x1fff ;
69 return ADC*TOF_CHARGE_FACTOR;
74 unsigned int ADC = (unsigned) (
charge/TOF_CHARGE_FACTOR);
75 unsigned int TDC = (unsigned) (time/TOF_TIME_FACTOR);
78 ADC = (ADC | 0x080000);
81 ADC = ( (TDC & 0x07e000) | ADC) ;
92 static const double MDC_TIME_FACTOR;
93 static const double MDC_CHARGE_FACTOR;
95 static const double TOF_TIME_FACTOR;
96 static const double TOF_CHARGE_FACTOR;
98 static const double EMC_CHARGE_HIGH_MEASURE;
99 static const double EMC_CHARGE_MID_MEASURE;
100 static const double EMC_CHARGE_LOW_MEASURE;
101 static const double EMC_TIME_FACTOR;
102 static const double EMC_CHARGE_FACTOR;
static double EmcTime(int timeChannel)
static int EmcChargeChannel(double charge)
static int MdcTimeChannel(double time)
static int EmcChargeMeasure(double charge)
static int MdcChargeChannel(double charge)
static double MdcTime(int timeChannel)
static unsigned int TofTimeChannel(double time)
static double TofTime(unsigned int timeChannel)
static double TofCharge(unsigned int chargeChannel)
static int EmcTimeChannel(double time)
static unsigned int TofChargeChannel(double charge, double time)
static double EmcCharge(int measure, int chargeChannel)
static double MdcCharge(int chargeChannel)