MEvent/Channel.h
Go to the documentation of this file.
1 #ifndef _mevt_Channel_h_
2 #define _mevt_Channel_h_
3 
4 #include <evt/ComponentGroup.h>
5 #include <mevt/ChannelRecData.h>
6 //
7 #include <utl/ShadowPtr.h>
8 #include <utl/Trace.h>
9 #include <utl/TimeStamp.h>
10 
11 
12 namespace mevt {
13 
23  class Channel {
24 
25  public:
27 
28  const utl::TraceB& GetTrace() const;
29 
30  void MakeTrace();
31 
32  bool HasTrace() const;
33 
39 
44 
45  bool HasTraceStartTime() const { return bool(fTimeStamp); }
46 
47  // Implicit ones.
48  //Channel(const Channel& chan);
49  //Channel& operator=(const Channel& chan);
50 
51  int GetId() const { return fId; }
52 
53  /* Mask used to exclude broken channels from the analysis
54  Broken channels are conserved in the data with fMasked set to true.
55  This can be useful, for example, to check that channels were masked correctly
56  */
57  void SetMask(bool mask) { fMasked = mask; }
58 
59  bool IsMasked() const { return fMasked; }
60 
62 
67 
68  const ChannelRecData& GetRecData() const { return *fRecData; }
69 
70  void MakeRecData();
71 
72  bool HasRecData() const { return bool(fRecData); }
73  //@
74 
75  private:
76  //Channel() { }
77 
79  Channel(const int cId) : fId(cId), fMasked(false) { }
80 
81  ~Channel() { }
82 
88 
95  template<class T>
96  friend void boost::checked_delete(T*) BOOST_NOEXCEPT;
97 
98  /*
99  * Should be the trace linked to a timestamp?
100  * Should be the channel hold multiple traces?
101  * Seems not: at first the channel has only
102  * a fixed size buffer (composed of two parts, see
103  * mdet::FrontEnd).
104  * An indentifier or timestamp may be associated
105  * but that seems to be a higher-level responsability.
106  */
107 
108  utl::ShadowPtr<utl::TraceB> fTrace;
109  utl::ShadowPtr<utl::TimeStamp> fTimeStamp;
110  int fId = -1;
111  bool fMasked = false;
112  utl::ShadowPtr<ChannelRecData> fRecData;
113 
114  };
115 
116 }
117 
118 
119 #endif
utl::TimeStamp GetTraceStartTime() const
Return the timestamp associated with the start of the trace. The timestamp of the first bin of the tr...
void SetMask(bool mask)
ChannelRecData & GetRecData()
utl::TraceB & GetTrace()
void SetTraceStartTime(const utl::TimeStamp &t)
Stablish the timestamp associated with the start of the trace.
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
bool HasRecData() const
bool HasTraceStartTime() const
utl::ShadowPtr< utl::TimeStamp > fTimeStamp
bool IsMasked() const
Trace< char > TraceB
Definition: Trace-fwd.h:28
int GetId() const
Common class for groups of components of the Event hierarchy.
utl::ShadowPtr< ChannelRecData > fRecData
const ChannelRecData & GetRecData() const
Channel(const int cId)
Constructs the Channel with the given identificator.
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Definition: Trace-fwd.h:19
Channel level event data.
friend void boost::checked_delete(T *) BOOST_NOEXCEPT
Friendship for destruction.
bool HasTrace() const
Channel level reconstruction data.
utl::ShadowPtr< utl::TraceB > fTrace

, generated on Tue Sep 26 2023.