StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrsAnalogSignal.cc
1 /*****************************************************************
2  *
3  * $Id: StTrsAnalogSignal.cc,v 1.6 2005/09/09 22:12:49 perev Exp $
4  *
5  * Author: brian Nov 1, 1998
6  *
7  *****************************************************************
8  * Description:
9  *
10  *****************************************************************
11  *
12  * $Log: StTrsAnalogSignal.cc,v $
13  * Revision 1.6 2005/09/09 22:12:49 perev
14  * Bug fix + IdTruth added
15  *
16  * Revision 1.5 2003/12/24 13:44:52 fisyak
17  * Add (GEANT) track Id information in Trs; propagate it via St_tpcdaq_Maker; account interface change in StTrsZeroSuppressedReaded in StMixerMaker
18  *
19  * Revision 1.4 2003/09/02 17:59:19 perev
20  * gcc 3.2 updates + WarnOff
21  *
22  * Revision 1.3 1999/01/15 11:02:57 lasiuk
23  * modify << operator for STL use
24  *
25  * Revision 1.2 1998/11/13 21:30:53 lasiuk
26  * << operator
27  *
28  * Revision 1.1 1998/11/10 17:12:23 fisyak
29  * Put Brian trs versin into StRoot
30  *
31  * Revision 1.1 1998/11/01 13:47:05 lasiuk
32  * Initial Revision
33  *
34  ******************************************************************/
35 #include <Stiostream.h>
36 #include "StTrsAnalogSignal.hh"
37 
38 //______________________________________________________________________________
39 StTrsAnalogSignal::StTrsAnalogSignal(float t, float amp, int id)
40 {
41  mId = id;
42  mTime = t;
43  mAmp = amp;
44 }
45 
46 //______________________________________________________________________________
47 StTrsAnalogSignal::StTrsAnalogSignal()
48 {
49  mId = 0;
50  mTime = 0;
51  mAmp = 0;
52 }
53 
54 //______________________________________________________________________________
55 StTrsAnalogSignal::~StTrsAnalogSignal() { /* nopt */}
56 
57 
58 //______________________________________________________________________________
59 // Non-member Function for printing
60 //template<class T>
61 ostream& operator<<(ostream& os, const StTrsAnalogSignal& sig)
62 {
63  return os << '(' << sig.time() << ", " << sig.amplitude() << ')';
64 }
65 //______________________________________________________________________________
66 StTrsAnalogSignal& StTrsAnalogSignal::operator+=(const StTrsAnalogSignal& other)
67 {
68  assert(mTime == other.mTime);
69  mAmp += other.mAmp; return *this;
70 }
71