StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrsAnalogSignal.hh
1 /*****************************************************************
2  *
3  * $Id: StTrsAnalogSignal.hh,v 1.7 2005/09/09 22:12:48 perev Exp $
4  *
5  * Author: brian Nov 1, 1998
6  *
7  *****************************************************************
8  * Description:
9  *
10  *****************************************************************
11  *
12  * $Log: StTrsAnalogSignal.hh,v $
13  * Revision 1.7 2005/09/09 22:12:48 perev
14  * Bug fix + IdTruth added
15  *
16  * Revision 1.6 2003/12/24 13:44:51 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.5 2003/09/02 17:59:16 perev
20  * gcc 3.2 updates + WarnOff
21  *
22  * Revision 1.4 2000/01/10 23:11:30 lasiuk
23  * Include MACROS for compatibility with SUN CC5.0
24  *
25  * Revision 1.3 1999/01/15 11:03:14 lasiuk
26  * modify << operator for STL use
27  *
28  * Revision 1.2 1998/11/13 21:29:46 lasiuk
29  * << operator
30  *
31  * Revision 1.1 1998/11/10 17:12:08 fisyak
32  * Put Brian trs versin into StRoot
33  *
34  * Revision 1.1 1998/11/01 13:46:43 lasiuk
35  * Initial Revision
36  *
37  ******************************************************************/
38 #ifndef ST_TRS_ANALOGSIGNAL_HH
39 #define ST_TRS_ANALOGSIGNAL_HH
40 #include <assert.h>
41 
42 #include <Stiostream.h>
43 #include <utility>
44 
45 #if defined (__SUNPRO_CC) && __SUNPRO_CC >= 0x500
46 using std::pair;
47 #endif
48 
50 public:
52  StTrsAnalogSignal(float, float, int id=0);
54  //StTrsAnalogSignal(const StTrsAnalogSignal&); // use default
55  //StTrsAnalogSignal& operator=(const StTrsAnalogSignal&); // use default
56  StTrsAnalogSignal& operator+=(const StTrsAnalogSignal&);
57 
58  // access functions
59  float time() const;
60  float amplitude() const;
61  int id() const {return mId;}
62 
63  void setTime(float);
64  void setAmplitude(float);
65  void scaleAmplitude(float);
66  void setId(int id) {mId = id;}
67 
68 protected:
69  int mId; // geant track no.
70  float mTime;
71  float mAmp;
72 };
73 
74 inline float StTrsAnalogSignal::time() const {return mTime;}
75 inline float StTrsAnalogSignal::amplitude() const {return mAmp; }
76 inline void StTrsAnalogSignal::setTime(float t) { mTime = t; }
77 inline void StTrsAnalogSignal::setAmplitude(float a) { mAmp = a; }
78 inline void StTrsAnalogSignal::scaleAmplitude(float fac){ mAmp *= fac;}
79 // Non-member function
80 ostream& operator<<(ostream&, const StTrsAnalogSignal&);
81 
83 public:
84  bool operator()(StTrsAnalogSignal x, StTrsAnalogSignal y)
85  {
86  return (x.time() < y.time());
87  }
88 };
89 
90 #endif