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