00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef ElecEvent_ElecPulse_H
00016 #define ElecEvent_ElecPulse_H 1
00017
00018
00019 #include "Conventions/Electronics.h"
00020 #include "GaudiKernel/boost_allocator.h"
00021 #include <ostream>
00022
00023
00024
00025 namespace DayaBay
00026 {
00027
00028
00029 class ElecPulseCollection;
00030 class SimHit;
00031
00032
00042 class ElecPulse
00043 {
00044 public:
00045
00047 ElecPulse() : m_pc(0),
00048 m_time(0.0),
00049 m_channelId(0),
00050 m_amplitude(0.0),
00051 m_ancestor(0),
00052 m_type(0) {}
00053
00055 virtual ~ElecPulse() {}
00056
00058 virtual std::ostream& fillStream(std::ostream& s) const;
00059
00062 const DayaBay::ElecPulseCollection* pc() const;
00063
00066 void setPc(DayaBay::ElecPulseCollection* value);
00067
00070 double time() const;
00071
00074 void setTime(double value);
00075
00078 const DayaBay::ElecChannelId& channelId() const;
00079
00082 void setChannelId(const DayaBay::ElecChannelId& value);
00083
00086 float amplitude() const;
00087
00090 void setAmplitude(float value);
00091
00094 const DayaBay::SimHit* ancestor() const;
00095
00098 DayaBay::SimHit* ancestor();
00099
00102 void setAncestor(DayaBay::SimHit* value);
00103
00106 int type() const;
00107
00110 void setType(int value);
00111
00112
00113 #ifndef GOD_NOALLOC
00115 static void* operator new ( size_t size )
00116 {
00117 return ( sizeof(ElecPulse) == size ?
00118 boost::singleton_pool<ElecPulse, sizeof(ElecPulse)>::malloc() :
00119 ::operator new(size) );
00120 }
00121
00125 static void* operator new ( size_t size, void* pObj )
00126 {
00127 return ::operator new (size,pObj);
00128 }
00129
00131 static void operator delete ( void* p )
00132 {
00133 boost::singleton_pool<ElecPulse, sizeof(ElecPulse)>::is_from(p) ?
00134 boost::singleton_pool<ElecPulse, sizeof(ElecPulse)>::free(p) :
00135 ::operator delete(p);
00136 }
00137
00140 static void operator delete ( void* p, void* pObj )
00141 {
00142 ::operator delete (p, pObj);
00143 }
00144 #endif
00145 protected:
00146
00147 private:
00148
00149 DayaBay::ElecPulseCollection* m_pc;
00150 double m_time;
00151 DayaBay::ElecChannelId m_channelId;
00152 float m_amplitude;
00153 DayaBay::SimHit* m_ancestor;
00154 int m_type;
00155
00156 };
00157
00158 inline std::ostream& operator<< (std::ostream& str, const ElecPulse& obj)
00159 {
00160 return obj.fillStream(str);
00161 }
00162
00163 }
00164
00165
00166
00167
00168
00169
00170 #include "ElecPulseCollection.h"
00171 #include "Event/SimHit.h"
00172
00173
00174 inline std::ostream& DayaBay::ElecPulse::fillStream(std::ostream& s) const
00175 {
00176 s << "{ " << "pc : " << m_pc << std::endl
00177 << "time : " << (float)m_time << std::endl
00178 << "channelId : " << m_channelId << std::endl
00179 << "amplitude : " << m_amplitude << std::endl
00180 << "ancestor : " << m_ancestor << std::endl
00181 << "type : " << m_type << std::endl << " }";
00182 return s;
00183 }
00184
00185
00186 inline const DayaBay::ElecPulseCollection* DayaBay::ElecPulse::pc() const
00187 {
00188 return m_pc;
00189 }
00190
00191 inline void DayaBay::ElecPulse::setPc(DayaBay::ElecPulseCollection* value)
00192 {
00193 m_pc = value;
00194 }
00195
00196 inline double DayaBay::ElecPulse::time() const
00197 {
00198 return m_time;
00199 }
00200
00201 inline void DayaBay::ElecPulse::setTime(double value)
00202 {
00203 m_time = value;
00204 }
00205
00206 inline const DayaBay::ElecChannelId& DayaBay::ElecPulse::channelId() const
00207 {
00208 return m_channelId;
00209 }
00210
00211 inline void DayaBay::ElecPulse::setChannelId(const DayaBay::ElecChannelId& value)
00212 {
00213 m_channelId = value;
00214 }
00215
00216 inline float DayaBay::ElecPulse::amplitude() const
00217 {
00218 return m_amplitude;
00219 }
00220
00221 inline void DayaBay::ElecPulse::setAmplitude(float value)
00222 {
00223 m_amplitude = value;
00224 }
00225
00226 inline const DayaBay::SimHit* DayaBay::ElecPulse::ancestor() const
00227 {
00228 return m_ancestor;
00229 }
00230
00231 inline DayaBay::SimHit* DayaBay::ElecPulse::ancestor()
00232 {
00233 return m_ancestor;
00234 }
00235
00236 inline void DayaBay::ElecPulse::setAncestor(DayaBay::SimHit* value)
00237 {
00238 m_ancestor = value;
00239 }
00240
00241 inline int DayaBay::ElecPulse::type() const
00242 {
00243 return m_type;
00244 }
00245
00246 inline void DayaBay::ElecPulse::setType(int value)
00247 {
00248 m_type = value;
00249 }
00250
00251
00252 #endif