BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RawEvent/include/RawEvent/RawData.h
Go to the documentation of this file.
1#ifndef RawData_H
2#define RawData_H
3#include "GaudiKernel/ContainedObject.h"
4#include "GaudiKernel/Kernel.h"
5#include "GaudiKernel/ObjectList.h"
6#include "GaudiKernel/ObjectVector.h"
7#include "GaudiKernel/SmartRefVector.h"
8#include "Identifier/Identifier.h"
9#include <algorithm>
10#include <cstdint>
11#include <functional>
12#include <iostream>
13#include <stdint.h>
14#include <vector>
15
16/*
17 *
18 */
19
20class RawData : virtual public ContainedObject {
21public:
22 // Constructor
23 RawData( const Identifier& id, const unsigned int timeChannel = 0,
24 const unsigned int chargeChannel = 0 );
25
26 RawData( const unsigned int id );
27
28 // Set time channel
29 void setTimeChannel( const unsigned int timeChannel );
30
31 // Set charge channel
32 void setChargeChannel( const unsigned int chargeChannel );
33
34 // Set track index
35 void setTrackIndex( const int trackIndex );
36
37 // Get associated id
38 virtual Identifier identify() const;
39
40 // Get associated int id
41 unsigned int getIntId() const;
42
43 // Get time channel
44 unsigned int getTimeChannel() const;
45
46 // Get charge channel
47 unsigned int getChargeChannel() const;
48
49 // Get track index
50 int getTrackIndex() const;
51
52 // Add two signals: if channel is the same, charge adds up, time set to the earliest value
53 RawData& operator+=( const RawData& );
54
55 //! Serialize the object for writing
56 virtual StreamBuffer& serialize( StreamBuffer& s ) const;
57 virtual StreamBuffer& serialize( StreamBuffer& s );
58
59 //! Fill the ASCII output stream
60 virtual std::ostream& fillStream( std::ostream& s ) const;
61
62protected:
63 RawData( const RawData& );
64
66
67 const Identifier m_id; // Offline ID for readout channel
68
69 unsigned int m_timeChannel;
70
71 unsigned int m_chargeChannel;
72
73 const unsigned int m_intId;
74
75 int m_trackIndex = -1;
76};
77
78//! Serialize the object for writing
79inline StreamBuffer& RawData::serialize( StreamBuffer& s ) const {
80 ContainedObject::serialize( s );
82 return s;
83}
84
85inline StreamBuffer& RawData::serialize( StreamBuffer& s ) { return serialize( s ); }
86
87//! Fill the ASCII output stream
88
89inline std::ostream& RawData::fillStream( std::ostream& s ) const {
90 s << "class RawData :" << std::endl
91 << " m_id: " << m_intId << " m_timeChannel: " << m_timeChannel
92 << " m_chargeChannel: " << m_chargeChannel << std::endl;
93 return s;
94}
95
96#endif
XmlRpcServer s
virtual std::ostream & fillStream(std::ostream &s) const
Fill the ASCII output stream.
unsigned int getIntId() const
Definition RawData.cxx:18
RawData(const Identifier &id, const unsigned int timeChannel=0, const unsigned int chargeChannel=0)
Definition RawData.cxx:4
RawData & operator=(const RawData &)
void setTrackIndex(const int trackIndex)
Definition RawData.cxx:29
virtual StreamBuffer & serialize(StreamBuffer &s) const
Serialize the object for writing.
virtual Identifier identify() const
Definition RawData.cxx:15
RawData(const RawData &)
void setChargeChannel(const unsigned int chargeChannel)
Definition RawData.cxx:24
unsigned int getChargeChannel() const
Definition RawData.cxx:35
void setTimeChannel(const unsigned int timeChannel)
Definition RawData.cxx:21
int getTrackIndex() const
Definition RawData.cxx:38
RawData & operator+=(const RawData &)
Definition RawData.cxx:40
unsigned int getTimeChannel() const
Definition RawData.cxx:32