Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawDataUtil Class Reference

#include <RawDataUtil.h>

List of all members.

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


Member Function Documentation

double RawDataUtil::EmcCharge int  measure,
int  chargeChannel
[inline, static]
 

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   }

double RawDataUtil::EmcCharge int  measure,
int  chargeChannel
[inline, static]
 

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   }

int RawDataUtil::EmcChargeChannel double  charge  )  [inline, static]
 

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   }

int RawDataUtil::EmcChargeChannel double  charge  )  [inline, static]
 

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   }

int RawDataUtil::EmcChargeMeasure double  charge  )  [inline, static]
 

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   }

int RawDataUtil::EmcChargeMeasure double  charge  )  [inline, static]
 

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   }

double RawDataUtil::EmcTime int  timeChannel  )  [inline, static]
 

00014 { return ((double)timeChannel)/EMC_TIME_FACTOR; }

double RawDataUtil::EmcTime int  timeChannel  )  [inline, static]
 

00014 { return ((double)timeChannel)/EMC_TIME_FACTOR; }

int RawDataUtil::EmcTimeChannel double  time  )  [inline, static]
 

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

int RawDataUtil::EmcTimeChannel double  time  )  [inline, static]
 

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

double RawDataUtil::MdcCharge int  chargeChannel  )  [inline, static]
 

00011 { return ((double)chargeChannel)*MDC_CHARGE_FACTOR; }    

double RawDataUtil::MdcCharge int  chargeChannel  )  [inline, static]
 

00011 { return ((double)chargeChannel)*MDC_CHARGE_FACTOR; }    

int RawDataUtil::MdcChargeChannel double  charge  )  [inline, static]
 

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

int RawDataUtil::MdcChargeChannel double  charge  )  [inline, static]
 

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

double RawDataUtil::MdcTime int  timeChannel  )  [inline, static]
 

00008 {  return  ((double)timeChannel)*MDC_TIME_FACTOR; }    

double RawDataUtil::MdcTime int  timeChannel  )  [inline, static]
 

00008 {  return  ((double)timeChannel)*MDC_TIME_FACTOR; }    

int RawDataUtil::MdcTimeChannel double  time  )  [inline, static]
 

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

int RawDataUtil::MdcTimeChannel double  time  )  [inline, static]
 

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

double RawDataUtil::TofCharge unsigned int  chargeChannel  )  [inline, static]
 

00067   { 
00068     double ADC = chargeChannel & 0x1fff ;
00069     return ADC*TOF_CHARGE_FACTOR; 
00070   }

double RawDataUtil::TofCharge unsigned int  chargeChannel  )  [inline, static]
 

00067   { 
00068     double ADC = chargeChannel & 0x1fff ;
00069     return ADC*TOF_CHARGE_FACTOR; 
00070   }

unsigned int RawDataUtil::TofChargeChannel double  charge,
double  time
[inline, static]
 

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   } 

unsigned int RawDataUtil::TofChargeChannel double  charge,
double  time
[inline, static]
 

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   } 

double RawDataUtil::TofTime unsigned int  timeChannel  )  [inline, static]
 

00063 { return ((double)timeChannel)*TOF_TIME_FACTOR; }

double RawDataUtil::TofTime unsigned int  timeChannel  )  [inline, static]
 

00063 { return ((double)timeChannel)*TOF_TIME_FACTOR; }

unsigned int RawDataUtil::TofTimeChannel double  time  )  [inline, static]
 

00064 { return (unsigned int)(time/TOF_TIME_FACTOR); } 

unsigned int RawDataUtil::TofTimeChannel double  time  )  [inline, static]
 

00064 { return (unsigned int)(time/TOF_TIME_FACTOR); } 


Member Data Documentation

const double RawDataUtil::EMC_CHARGE_FACTOR = 1024 [static, private]
 

const double RawDataUtil::EMC_CHARGE_HIGH_MEASURE = 2500. [static, private]
 

const double RawDataUtil::EMC_CHARGE_LOW_MEASURE = 78. [static, private]
 

const double RawDataUtil::EMC_CHARGE_MID_MEASURE = 625. [static, private]
 

const double RawDataUtil::EMC_TIME_FACTOR = 1 [static, private]
 

const double RawDataUtil::MDC_CHARGE_FACTOR = 1. [static, private]
 

const double RawDataUtil::MDC_TIME_FACTOR = 0.09375 [static, private]
 

const double RawDataUtil::TOF_CHARGE_FACTOR = 0.3 [static, private]
 

const double RawDataUtil::TOF_TIME_FACTOR = 0.00293 [static, private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:43:11 2011 for BOSS6.5.5 by  doxygen 1.3.9.1