Adc Class Reference

#include <TofData.h>

Inheritance diagram for Adc:

TofValue List of all members.

Public Member Functions

 Adc ()
void setCorr ()
void setElec ()
void setValue (Identifier identify, int value)
double qtc () const
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)
void setUsed (bool used)

Protected Attributes

int m_clock
int m_channel
double m_value

Private Attributes

double m_qtc
bool m_corr
bool m_elec
bool m_mrpc

Detailed Description

Definition at line 43 of file TofData.h.


Constructor & Destructor Documentation

Adc::Adc (  ) 

Definition at line 69 of file TofData.cxx.

References m_corr, m_elec, m_mrpc, and m_qtc.

00069          {
00070   m_corr = false;
00071   m_elec = false;
00072   m_mrpc = false;
00073   m_qtc  = -999.0;
00074 }


Member Function Documentation

int TofValue::channel (  )  const [inline, inherited]

Definition at line 17 of file TofData.h.

References TofValue::m_channel.

Referenced by PmtData::adc(), PmtData::adcChannel(), and PmtData::tdcChannel().

00017 { return  m_channel;     }

int TofValue::clock (  )  const [inline, inherited]

Definition at line 20 of file TofData.h.

References TofValue::m_clock.

Referenced by PmtData::qclock(), and PmtData::tclock().

00020 { return  m_clock;       }

int TofValue::number ( void   )  const [inline, inherited]

Definition at line 19 of file TofData.h.

References TofValue::m_number.

Referenced by PmtData::qnumber(), and PmtData::tnumber().

00019 { return  m_number;      }

double Adc::qtc (  )  const [inline]

Definition at line 52 of file TofData.h.

References m_qtc.

Referenced by PmtData::adc(), and PmtData::qtc().

00052 { return  m_qtc;         }

void Adc::setCorr (  )  [inline]

Definition at line 47 of file TofData.h.

References m_corr.

Referenced by TofRawDataProvider::tofDataMapFull().

00047 { m_corr   = true;       }

void Adc::setElec (  )  [inline]

Definition at line 48 of file TofData.h.

References m_elec.

Referenced by TofRawDataProvider::tofDataMapFull().

00048 { m_elec   = true;       }

void TofValue::setNumber ( int  number  )  [inline, inherited]

Definition at line 26 of file TofData.h.

References TofValue::m_number.

Referenced by TofRawDataProvider::tofDataMapFull().

00026 { m_number = number;     }

void TofValue::setUsed ( bool  used  )  [inline, inherited]

Definition at line 28 of file TofData.h.

References TofValue::m_used.

Referenced by PmtData::setUsed().

00028 { m_used   = used;       }

void Adc::setValue ( Identifier  identify,
int  value 
)

Definition at line 77 of file TofData.cxx.

References TofID::barrel_ec(), ITofQCorrSvc::BQRaw1(), ITofQCorrSvc::BQRaw2(), ITofQElecSvc::BQTC1(), ITofQElecSvc::BQTC2(), TofID::end(), ITofQCorrSvc::EQRaw(), ITofQElecSvc::EQTC(), TofID::is_mrpc(), TofID::is_scin(), TofID::layer(), TofValue::m_channel, TofValue::m_clock, m_corr, m_elec, m_mrpc, m_qtc, TofValue::m_value, TofID::phi_module(), tofQCorrSvc, tofQElecSvc, and RawDataUtil::TofTime().

Referenced by TofRawDataProvider::tofDataMapFull().

00077                                                    {
00078   m_clock = ( ( value & 0x7e000 ) >> 13 );
00079   if( value == 0x7fffffff ) {
00080     m_clock      = 100;
00081     m_channel    = 10000;
00082     m_qtc        = 10000.0;
00083     m_value      = 10000.0;
00084   }
00085   else if( value == -999 ) {
00086     m_channel    = -999;
00087     m_qtc        = -999.0;
00088     m_value      = -999.0;
00089   }
00090   else {
00091 
00092     m_mrpc = TofID::is_mrpc( identify );
00093     if( m_mrpc ) {
00094       m_channel = value;
00095       m_qtc = RawDataUtil::TofTime( m_channel );
00096     }
00097     else {
00098       if( !( TofID::is_scin( identify ) ) ) {
00099         std::cout << "Event/RawDataProviderSvc:: ERROR! ETF(MRPC) data is treated as scintillator data !" << std::endl;
00100       }
00101 
00102       m_channel = ( value  & 0x1fff );
00103       if( ( value & 0x80000 ) != 0 ) {
00104         if( m_corr ) { 
00105           if( m_channel < 4000 ) {
00106             m_channel += 0x2000;
00107           }
00108         }
00109         else {
00110           m_channel += 0x2000;
00111         }
00112       }
00113 
00114       int barrel = TofID::barrel_ec( identify );
00115       int tofid  = TofID::phi_module( identify );
00116       int layer  = TofID::layer( identify );
00117       if( barrel==1 ) {
00118         if( layer==1 ) {
00119           tofid = tofid + 88;
00120         }
00121       }
00122       else if( barrel==2 ) {
00123         tofid = tofid + 48;
00124       }
00125       int east = TofID::end( identify );
00126 
00127       if( m_corr ) {
00128         if( barrel==1 ) {
00129           if( east==0 ) {
00130             m_qtc = tofQCorrSvc->BQRaw1( tofid, m_channel*1.0 );
00131           }
00132           else {
00133             m_qtc = tofQCorrSvc->BQRaw2( tofid, m_channel*1.0 );
00134           }
00135         }
00136         else {
00137           m_qtc = tofQCorrSvc->EQRaw( tofid, m_channel*1.0 );
00138         }
00139       }
00140       else {
00141         m_qtc = m_channel*1.0;
00142       }
00143 
00144       if( m_elec ) {
00145         if( barrel==1 ) {
00146           if( east==0 ) {
00147             m_value = tofQElecSvc->BQTC1( tofid, m_qtc );
00148           }
00149           else {
00150             m_value = tofQElecSvc->BQTC2( tofid, m_qtc );
00151           }
00152         }
00153         else {
00154           m_value = tofQElecSvc->EQTC( tofid, m_qtc );
00155         }
00156       }
00157       else {
00158         m_value = m_qtc*1.0;
00159       }
00160     }
00161 
00162   }
00163   return;
00164 }

int TofValue::times (  )  const [inline, inherited]

Definition at line 18 of file TofData.h.

References TofValue::m_times.

Referenced by PmtData::clear(), PmtData::qtimes(), PmtData::setAdc(), PmtData::setTdc(), and PmtData::ttimes().

00018 { return  m_times;       }

void TofValue::timesmm (  )  [inherited]

Definition at line 43 of file TofData.cxx.

References TofValue::m_times.

Referenced by PmtData::clear(), PmtData::qtimesmm(), and PmtData::ttimesmm().

00043                        {
00044   m_times = m_times - 1;
00045   return;
00046 }

void TofValue::timespp (  )  [inherited]

Definition at line 37 of file TofData.cxx.

References TofValue::m_times.

Referenced by PmtData::qtimespp(), PmtData::setAdc(), PmtData::setTdc(), and PmtData::ttimespp().

00037                        {
00038   m_times = m_times + 1;
00039   return;
00040 }

bool TofValue::used (  )  const [inline, inherited]

Definition at line 22 of file TofData.h.

References TofValue::m_used.

Referenced by PmtData::qused(), PmtData::tused(), and PmtData::used().

00022 { return  m_used;        }

double TofValue::value (  )  const [inline, inherited]

Definition at line 21 of file TofData.h.

References TofValue::m_value.

Referenced by PmtData::adc(), and PmtData::tdc().

00021 { return  m_value;       }


Member Data Documentation

int TofValue::m_channel [protected, inherited]

Definition at line 32 of file TofData.h.

Referenced by TofValue::channel(), TofValue::operator=(), setValue(), Tdc::setValue(), and TofValue::TofValue().

int TofValue::m_clock [protected, inherited]

Definition at line 31 of file TofData.h.

Referenced by TofValue::clock(), TofValue::operator=(), setValue(), Tdc::setValue(), and TofValue::TofValue().

bool Adc::m_corr [private]

Definition at line 56 of file TofData.h.

Referenced by Adc(), setCorr(), and setValue().

bool Adc::m_elec [private]

Definition at line 56 of file TofData.h.

Referenced by Adc(), setElec(), and setValue().

bool Adc::m_mrpc [private]

Definition at line 56 of file TofData.h.

Referenced by Adc(), and setValue().

double Adc::m_qtc [private]

Definition at line 55 of file TofData.h.

Referenced by Adc(), qtc(), and setValue().

double TofValue::m_value [protected, inherited]

Definition at line 33 of file TofData.h.

Referenced by TofValue::operator=(), setValue(), Tdc::setValue(), TofValue::TofValue(), and TofValue::value().


Generated on Tue Nov 29 23:17:26 2016 for BOSS_7.0.2 by  doxygen 1.4.7