CMS 3D CMS Logo

i2oStorageManagerMsg.h

Go to the documentation of this file.
00001 #ifndef __i2oStorageManagerMsg_h__
00002 #define __i2oStorageManagerMsg_h__
00003 
00004 #include "i2o/i2o.h"
00005 #include <string.h>
00006 
00007 #include "IOPool/Streamer/interface/MsgTools.h"
00008 
00009 /*
00010    Description:
00011      Used for FU I2O frame output module and by the
00012      Storage Manager I2O input
00013      See CMS EvF Storage Manager wiki page for further notes.
00014 
00015    $Id: i2oStorageManagerMsg.h,v 1.11 2007/02/14 00:58:58 hcheung Exp $
00016 */
00017 
00018 // These are the I2O function codes (should be) reserved for SM use
00019 #define I2O_SM_PREAMBLE 0x001a
00020 #define I2O_SM_DATA     0x001b
00021 #define I2O_SM_OTHER    0x001c
00022 #define I2O_SM_DQM      0x001d
00023 //
00024 // RunNumber_t and EventNumber_t are unsigned long variables
00025 // We will use uint32 instead for 64-bit compatibility
00026 //
00027 // source (FU/HLT) id could be compressed into fewer bytes!
00028 //
00029 // max I2O frame is (2**16 - 1) * 4 = 65535 * 4 = 262140
00030 // but this size should also be a multiple of 64 bits (8 bytes)
00031 #define I2O_ABSOLUTE_MAX_SIZE 262136
00032 // Illustrate calculation of max data I2O frame for given KB:
00033 // If 32KB (e.g. for MTCC-I) max = (2**13 - 1) * 4 = 32764 
00034 // but to be a multiple of 8 bytes it needs to be = 32760
00035 //
00036 // Actual value can be defined to any multiple of 8 bytes
00037 // and less than I2O_ABSOLUTE_MAX_SIZE
00038 // set the default if no value is given in the output module
00039 #define I2O_MAX_SIZE 64000
00040 // max data I2O frame needs to be calculated as e.g.
00041 // I2O_MAX_SIZE - headers = I2O_MAX_SIZE - 28 -136
00042 // now done dynamically in e.g. FUStreamerI2OWriter.cc
00043 //
00044 // maximum characters for the source class name and url
00045 #define MAX_I2O_SM_URLCHARS 50
00046 
00051 struct _I2O_SM_MULTIPART_MESSAGE_FRAME {
00052    I2O_PRIVATE_MESSAGE_FRAME PvtMessageFrame;
00053    uint32                    dataSize;
00054    char                      hltURL[MAX_I2O_SM_URLCHARS];
00055    char                      hltClassName[MAX_I2O_SM_URLCHARS];
00056    uint32                    hltLocalId;
00057    uint32                    hltInstance;
00058    uint32                    hltTid;
00059    uint32                    numFrames;
00060    uint32                    frameCount;
00061    uint32                    originalSize;
00062 };
00063 
00064 typedef struct _I2O_SM_MULTIPART_MESSAGE_FRAME
00065     I2O_SM_MULTIPART_MESSAGE_FRAME, *PI2O_SM_MULTIPART_MESSAGE_FRAME;
00066 
00071 typedef struct _I2O_SM_PREAMBLE_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME {
00072    char* dataPtr()           const { return (char*)this+sizeof(_I2O_SM_PREAMBLE_MESSAGE_FRAME); }
00073 } I2O_SM_PREAMBLE_MESSAGE_FRAME, *PI2O_SM_PREAMBLE_MESSAGE_FRAME;
00074 
00078 typedef struct _I2O_SM_DATA_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME {
00079    uint32                    runID;
00080    uint32                    eventID;
00081    char* dataPtr()           const { return (char*)this+sizeof(_I2O_SM_DATA_MESSAGE_FRAME); }
00082 } I2O_SM_DATA_MESSAGE_FRAME, *PI2O_SM_DATA_MESSAGE_FRAME;
00083 
00087 typedef struct _I2O_SM_OTHER_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME {
00088    uint32                    otherData;
00089    char* dataPtr()           const { return (char*)this+sizeof(_I2O_SM_OTHER_MESSAGE_FRAME); }
00090 } I2O_SM_OTHER_MESSAGE_FRAME, *PI2O_SM_OTHER_MESSAGE_FRAME;
00091 
00095 typedef struct _I2O_SM_DQM_MESSAGE_FRAME : _I2O_SM_MULTIPART_MESSAGE_FRAME {
00096    uint32                    runID;
00097    uint32                    eventAtUpdateID;
00098    uint32                    folderID;
00099    char* dataPtr()           const { return (char*)this+sizeof(_I2O_SM_DQM_MESSAGE_FRAME); }
00100 } I2O_SM_DQM_MESSAGE_FRAME, *PI2O_SM_DQM_MESSAGE_FRAME;
00101 
00102 #endif

Generated on Tue Jun 9 17:34:52 2009 for CMSSW by  doxygen 1.5.4