StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTofData.cxx
1 /***************************************************************************
2  *
3  * $Id: StTofData.cxx,v 2.3 2005/04/11 22:35:25 calderon Exp $
4  *
5  * Author: W.J. Llope, Sep 2001
6  ***************************************************************************
7  *
8  * Description: TOFp Systems raw data (TOFp+pVPD)
9  *
10  ***************************************************************************
11  *
12  * $Log: StTofData.cxx,v $
13  * Revision 2.3 2005/04/11 22:35:25 calderon
14  * Tof Classes for Run 5. Modifications and additions from Xin to
15  * take care of new TOF daq and electronics. Added StTofRawData and
16  * modified containers and includes.
17  *
18  * Revision 2.2 2003/05/21 18:22:46 ullrich
19  * Major Revision of ToF classes (F. Geurts)
20  *
21  * Revision 2.1 2001/10/01 19:39:52 ullrich
22  * Initial Revision.
23  *
24  **************************************************************************/
25 
26 #include "StTofData.h"
27 
28 static const char rcsid[] = "$Id: StTofData.cxx,v 2.3 2005/04/11 22:35:25 calderon Exp $";
29 
30 ClassImp(StTofData)
31 
33  : mDataIndex(0), mAdc(0), mTdc(0), mTc(0), mSc(0), mLeadingTdc(0), mTrailingTdc(0)
34 { /* noop */ }
35 
36 StTofData::StTofData(unsigned short dataId, unsigned short rawAdc,
37  unsigned short rawTdc, short rawTc, unsigned short rawSc,
38  unsigned int rawLTdc, unsigned int rawTTdc)
39  : mDataIndex(dataId), mAdc(rawAdc), mTdc(rawTdc), mTc(rawTc), mSc(rawSc),
40  mLeadingTdc(rawLTdc), mTrailingTdc(rawTTdc)
41 { /* noop */ }
42 
43 StTofData::~StTofData() { /* noop */ }
44 
45 int StTofData::operator==(const StTofData& p) const
46 {
47  return (p.mDataIndex == mDataIndex &&
48  p.mAdc == mAdc && p.mTdc == mTdc &&
49  p.mTc == mTc && p.mSc == mSc &&
50  p.mLeadingTdc == mLeadingTdc && p.mTrailingTdc == mTrailingTdc);
51 }
52 
53 int StTofData::operator!=(const StTofData& p) const
54 {
55  return !(*this == p); // use operator==()
56 }
57 
58 ostream& operator<<(ostream& os, const StTofData& d)
59 {
60  return (os << "StTofData::> "<< " ID=" << d.dataIndex()
61  << ", adc=" << d.adc()
62  << ", tdc=" << d.tdc()
63  << ", tc=" << d.tc()
64  << ", sc=" << d.sc());
65  // << ", leading tdc =" << d.leadingTdc()
66  // << ", trailing tdc =" << d.trailingTdc());
67 }
68