1#include "RawEvent/RawDataUtil.h"
2#include "RawDataProviderSvc/TofData.h"
3#include "TofQCorrSvc/ITofQCorrSvc.h"
4#include "TofQElecSvc/ITofQElecSvc.h"
5#include "Identifier/Identifier.h"
6#include "Identifier/TofID.h"
29 m_times = source.m_times;
30 m_number = source.m_number;
32 m_used = source.m_used;
38 m_times = m_times + 1;
44 m_times = m_times - 1;
51 if(
value == 0x7fffffff ) {
56 else if(
value == -999 ) {
79 if(
value == 0x7fffffff ) {
85 else if(
value == -999 ) {
99 std::cout <<
"Event/RawDataProviderSvc:: ERROR! ETF(MRPC) data is treated as scintillator data !" << std::endl;
103 if( (
value & 0x80000 ) != 0 ) {
122 else if( barrel==2 ) {
261 m_iden_value = source.m_iden_value;
262 m_times = source.m_times;
263 m_quality = source.m_quality;
264 m_adc = source.m_adc;
265 m_tdc = source.m_tdc;
280 double value = -999.0;
282 value = m_adc->
qtc();
294 double value = -999.0;
299 double tleading = m_tdc->
value();
301 int qchannel = m_adc->
channel();
302 if( qchannel!=10000 && qchannel!=-999 ) {
303 double ttrailing = m_adc->
qtc();
304 value = ttrailing - tleading;
310 value = m_adc->
value();
325 clock = m_adc->
clock();
341 double value = -999.;
343 value = m_tdc->
value();
352 clock = m_tdc->
clock();
359 m_times = m_times + 1;
365 m_times = m_times - 1;
470 if(
adc->channel() != -999 ) {
472 m_quality = ( m_quality | 0x2 );
480 if(
tdc->channel() != -999 ) {
482 m_quality = ( m_quality | 0x1 );
501 if( m_adc->
times() <= 1 ) {
510 if( m_tdc->
times() <= 1 ) {
543 m_identify = source.m_identify;
544 m_mrpc = source.m_mrpc;
545 m_barrel = source.m_barrel;
546 m_tofId = source.m_tofId;
547 m_layer = source.m_layer;
548 m_strip = source.m_strip;
549 m_tofTrackId = source.m_tofTrackId;
550 m_misLable = source.m_misLable;
551 m_quality = source.m_quality;
552 m_tmatched = source.m_tmatched;
553 m_forward = source.m_forward;
554 m_backward = source.m_backward;
555 m_ztdc = source.m_ztdc;
556 m_zadc = source.m_zadc;
557 m_zpos = source.m_zpos;
558 m_energy = source.m_energy;
584 if( barrel_ec == 0 ) {
587 else if( barrel_ec == 1 ) {
589 if( m_layer == 1 ) { m_tofId = m_tofId + 88; }
591 else if( barrel_ec == 2 ) {
593 m_tofId = m_tofId + 48;
601 m_tofId = m_tofId + 36;
610void TofData::data(
double& adcEast,
double& tdcEast,
double& adcWest,
double& tdcWest ) {
614 adcEast = m_forward->
adc();
615 tdcEast = m_forward->
tdc();
620 adcWest = m_backward->
adc();
621 tdcWest = m_backward->
tdc();
639 double value = -999.;
641 value = m_forward->
adc();
648 double value = -999.;
650 value = m_forward->
tdc();
657 double value = -999.;
659 value = m_backward->
adc();
666 double value = -999.;
668 value = m_backward->
tdc();
675 double value = -999.;
677 value = m_forward->
adc();
684 double value = -999.;
686 value = m_forward->
tdc();
693 double value = -999.;
695 value = m_forward->
qtc();
702 double value = -999.;
704 value = m_backward->
qtc();
711 double value = -999.;
713 value = m_forward->
qtc();
776 clock = m_forward->
qclock();
785 clock = m_forward->
tclock();
794 clock = m_backward->
qclock();
803 clock = m_backward->
tclock();
812 clock = m_forward->
qclock();
821 clock = m_forward->
tclock();
902 number = m_backward->
qnumber();
911 number = m_backward->
tnumber();
996 m_quality = ( m_quality | (
quality << 2 ) );
1007 if( (
quality & 0x1 ) != 0 ) {
1010 if( (
quality & 0x2 ) != 0 ) {
1014 m_quality = ( m_quality |
quality );
1032 if( m_forward->
times() <= 1 ) {
1041 if( m_backward->
times() <= 1 ) {
ITofQElecSvc * tofQElecSvc
ITofQCorrSvc * tofQCorrSvc
void setValue(Identifier identify, int value)
virtual const double BQRaw1(int id, double q)=0
virtual const double EQRaw(int id, double q)=0
virtual const double BQRaw2(int id, double q)=0
virtual const double BQTC2(int id, double q)=0
virtual const double BQTC1(int id, double q)=0
virtual const double EQTC(int id, double q)=0
unsigned int times() const
unsigned int quality() const
PmtData & operator=(const PmtData &source)
static double TofTime(unsigned int timeChannel)
unsigned int quality() const
void data(double &adcEast, double &tdcEast, double &adcWest, double &tdcWest)
void setForward(PmtData *pmt)
unsigned int times() const
TofData & operator=(const TofData &source)
unsigned int identify() const
void setBackward(PmtData *pmt)
void setIdentify(Identifier identify)
static int endcap(const Identifier &id)
static int strip(const Identifier &id)
static Identifier cell_id(int barrel_ec, int layer, int phi_module, int end)
For a single crystal.
static bool is_scin(const Identifier &id)
static int end(const Identifier &id)
static bool is_mrpc(const Identifier &id)
static int phi_module(const Identifier &id)
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
static int layer(const Identifier &id)
static int module(const Identifier &id)
TofValue & operator=(const TofValue &source)