1 |
kusanagi |
1.1 |
/** @file |
2 |
kusanagi |
2.0 |
* $Source: /home/cvsmanager/yoda/event/SubPacket.h,v $ |
3 |
kusanagi |
2.2 |
* $Id: SubPacket.h,v 2.1 2004/10/17 12:28:15 kusanagi Exp $ |
4 |
kusanagi |
2.0 |
* $Author: kusanagi $ |
5 |
kusanagi |
1.1 |
* |
6 |
|
|
* Header file for the SubPacket class. |
7 |
|
|
*/ |
8 |
|
|
#ifndef SUB_PACKET_H |
9 |
|
|
#define SUB_PACKET_H |
10 |
|
|
|
11 |
kusanagi |
2.2 |
#define BYTE unsigned char |
12 |
|
|
#define UINT32 unsigned int |
13 |
|
|
#define UINT16 unsigned short |
14 |
|
|
#define UINT8 unsigned char |
15 |
kusanagi |
1.1 |
#include "PacketType.h" |
16 |
|
|
#include "SubDetector.h" |
17 |
kusanagi |
2.2 |
#include "TObject.h" |
18 |
kusanagi |
1.1 |
|
19 |
|
|
namespace pamela { |
20 |
|
|
/** |
21 |
|
|
* A SubPacket is the basic structure of all event data in the ROOT storage. |
22 |
|
|
* Every ROOT tree is built on top of one SubPacket. An analys step |
23 |
|
|
* which wants to save data needs to create a SubPacket. |
24 |
|
|
*/ |
25 |
|
|
class SubPacket: public TObject { |
26 |
|
|
private: |
27 |
|
|
/** |
28 |
|
|
* The packet type of the sub packet. |
29 |
|
|
*/ |
30 |
|
|
const pamela::PacketType* Type; //! |
31 |
|
|
/** |
32 |
|
|
* The subdetector this packet belongs to, or 0 if it is not specific to |
33 |
|
|
* any subdetector. |
34 |
|
|
*/ |
35 |
|
|
const pamela::SubDetector* Detector; //! |
36 |
|
|
/** |
37 |
|
|
* The name of the subpacket. |
38 |
|
|
*/ |
39 |
|
|
std::string SubPacketName; //! |
40 |
|
|
protected: |
41 |
|
|
SubPacket(std::string, const pamela::PacketType* = 0, const pamela::SubDetector* = 0); |
42 |
kusanagi |
2.2 |
virtual const char* Print(){ return "SubType"; } |
43 |
|
|
std::stringstream oss; //! |
44 |
kusanagi |
1.1 |
public: |
45 |
|
|
SubPacket(void); |
46 |
|
|
/** |
47 |
|
|
* Get the name of the SubPacket. |
48 |
|
|
*/ |
49 |
|
|
virtual std::string GetSubPacketName(void) const { return SubPacketName; } |
50 |
|
|
/** |
51 |
|
|
* Return TRUE if the SubPacket belongs to a certain subdetector. |
52 |
|
|
*/ |
53 |
|
|
bool IsDetectorSpecific(void) const { return (Detector != 0); } |
54 |
|
|
/** |
55 |
|
|
* Get the subdetector if the SubPacket is detector specific. |
56 |
|
|
*/ |
57 |
|
|
const pamela::SubDetector* GetSubDetector(void) const { return Detector; } |
58 |
|
|
/** |
59 |
|
|
* Get the packet type (physics, orbital etc.) the SubPacket belongs to. |
60 |
|
|
*/ |
61 |
|
|
const pamela::PacketType* GetPacketType(void) const { return Type; } |
62 |
kusanagi |
2.2 |
|
63 |
kusanagi |
1.1 |
ClassDef(SubPacket, 1) |
64 |
|
|
}; |
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
#endif /* SUB_PACKET_H */ |
68 |
|
|
|