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