CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FUShmOutputModule.h
Go to the documentation of this file.
1 #ifndef _FUShmOutputModule_h
2 #define _FUShmOutputModule_h
3 
4 /*
5  Description:
6  Header file shared memory to be used with FUShmOutputModule.
7  See CMS EvF Storage Manager wiki page for further notes.
8 
9  $Id: FUShmOutputModule.h,v 1.12 2012/10/11 17:48:11 smorovic Exp $
10 */
11 
15 
20 
23 
24 #include <iostream>
25 
26 // Data structure to be shared by all output modules for event serialization
28 {
30  shmBuffer_(0)
31  { }
32 
34  if(!shmBuffer_) {
36  return shmBuffer_;
37  } else {
38  return shmBuffer_;
39  }
40  }
41  void detachShmBuffer() {
42  if(!shmBuffer_) {
43  // no shared memory was attached to!
44  } else {
45  shmdt(shmBuffer_);
46  shmBuffer_ = 0;
47  }
48  }
50  return shmBuffer_;
51  }
52 
54 };
55 
56 namespace edm
57 {
58  //class ParameterSetDescription;
60  {
61  public:
62 
65 
66  void insertStreamAndDatasetInfo(edm::ParameterSet & streams, edm::ParameterSet datasets/*std:std::string & moduleList*/);
67  void doOutputHeader(InitMsgBuilder const& initMessage);
68  void doOutputEvent(EventMsgBuilder const& eventMessage);
69  unsigned int getCounts(){
70  return count_;
71  }
72  void start();
73  void stop();
75 
76  void parseDatasets(InitMsgView const& initMessage);
77  void countEventForDatasets(EventMsgView const& eventMessage);
78  std::vector<std::string> getDatasetNames() {return selectedDatasetNames_;}
79  std::vector<unsigned int>& getDatasetCounts() {return datasetCounts_;}
81  for (unsigned int i=0;i<datasetCounts_.size();i++) datasetCounts_[i]=0;
82  }
84 
85  //void writeLuminosityBlock(LuminosityBlockPrincipal const&);
86  void setPostponeInitMsg();
87  void sendPostponedStart();
88  void sendPostponedInitMsg();
89  void setNExpectedEPs(unsigned int EPs);
90  void unregisterFromShm();
91 
92  private:
93 
96  unsigned int count_;
97 
98  static bool fuIdsInitialized_;
100  unsigned int nExpectedEPs_;
101 
102  //dataset parsing
103  std::vector<unsigned int> datasetCounts_;
104 
105  unsigned int numDatasets_;
106  std::vector<std::string> selectedDatasetNames_;
107  std::vector<Strings> datasetPaths_;
108  std::vector<std::pair<std::string,edm::EventSelector*>> dpEventSelectors_;
109  unsigned int totalPaths_;
110 
112  };
113 }
114 
115 #endif
int i
Definition: DBlmapReader.cc:9
FUShmOutputModule(edm::ParameterSet const &ps)
std::vector< std::string > selectedDatasetNames_
static FUShmBuffer * getShmBuffer()
Definition: FUShmBuffer.cc:986
evf::FUShmBuffer * shmBuffer_
std::vector< std::string > getDatasetNames()
std::vector< unsigned int > datasetCounts_
void insertStreamAndDatasetInfo(edm::ParameterSet &streams, edm::ParameterSet datasets)
void setNExpectedEPs(unsigned int EPs)
void doOutputHeader(InitMsgBuilder const &initMessage)
std::vector< Strings > datasetPaths_
std::vector< unsigned int > & getDatasetCounts()
evf::FUShmBuffer * getShmBuffer()
unsigned int uint32
Definition: MsgTools.h:13
evf::FUShmBuffer * getBufferRef()
std::vector< std::pair< std::string, edm::EventSelector * > > dpEventSelectors_
void doOutputEvent(EventMsgBuilder const &eventMessage)
void countEventForDatasets(EventMsgView const &eventMessage)
void parseDatasets(InitMsgView const &initMessage)
evf::FUShmBuffer * shmBuffer_
static void fillDescription(ParameterSetDescription &)