00001 // $Id: I2OChain.h,v 1.14 2011/03/08 18:34:11 mommsen Exp $ 00003 00004 #ifndef EventFilter_StorageManager_I2OChain_h 00005 #define EventFilter_StorageManager_I2OChain_h 00006 00007 #include <vector> 00008 00009 #include "boost/shared_ptr.hpp" 00010 #include "toolbox/mem/Reference.h" 00011 00012 #include "IOPool/Streamer/interface/HLTInfo.h" 00013 #include "EventFilter/StorageManager/interface/QueueID.h" 00014 #include "EventFilter/StorageManager/interface/StreamID.h" 00015 #include "EventFilter/StorageManager/interface/Utils.h" 00016 00017 00018 namespace stor { 00019 00020 class DQMKey; 00021 00022 00036 // We need only declare ChainData here; it is defined in I2OChain.cc. 00037 namespace detail 00038 { 00039 class ChainData; 00040 } 00041 00042 class I2OChain 00043 { 00044 public: 00045 00046 00050 I2OChain(); 00051 00061 explicit I2OChain(toolbox::mem::Reference* pRef); 00062 00067 I2OChain(I2OChain const& other); 00068 00073 ~I2OChain(); 00074 00083 I2OChain& operator=(I2OChain const& rhs); 00084 00088 void swap(I2OChain& other); 00089 00093 bool empty() const; 00094 00098 bool complete() const; 00099 00105 bool faulty() const; 00106 00110 unsigned int faultyBits() const; 00111 00126 void addToChain(I2OChain& newpart); 00127 00131 //void markComplete(); 00132 00139 void markFaulty(); 00140 00146 unsigned long* getBufferData() const; 00147 00148 00154 void release(); 00155 00165 utils::TimePoint_t creationTime() const; 00166 00175 utils::TimePoint_t lastFragmentTime() const; 00176 00186 utils::TimePoint_t staleWindowStartTime() const; 00187 00191 void addToStaleWindowStartTime(const utils::Duration_t); 00192 00196 void resetStaleWindowStartTime(); 00197 00203 void tagForStream(StreamID); 00204 00210 void tagForEventConsumer(QueueID); 00211 00217 void tagForDQMEventConsumer(QueueID); 00218 00223 bool isTaggedForAnyStream() const; 00224 00229 bool isTaggedForAnyEventConsumer() const; 00230 00235 bool isTaggedForAnyDQMEventConsumer() const; 00236 00245 std::vector<StreamID> getStreamTags() const; 00246 00255 QueueIDs getEventConsumerTags() const; 00256 00265 QueueIDs getDQMEventConsumerTags() const; 00266 00270 unsigned int droppedEventsCount() const; 00271 00276 void setDroppedEventsCount(unsigned int); 00277 00283 unsigned int messageCode() const; 00284 00290 unsigned short i2oMessageCode() const; 00291 00298 unsigned int rbBufferId() const; 00299 00306 unsigned int hltLocalId() const; 00307 00314 unsigned int hltInstance() const; 00315 00322 unsigned int hltTid() const; 00323 00330 std::string hltURL() const; 00331 00338 std::string hltClassName() const; 00339 00346 unsigned int fuProcessId() const; 00347 00354 unsigned int fuGuid() const; 00355 00361 FragKey fragmentKey() const; 00362 00363 00368 size_t memoryUsed() const; 00369 00379 unsigned int fragmentCount() const; 00380 00391 unsigned long totalDataSize() const; 00392 00403 unsigned long dataSize(int fragmentIndex) const; 00404 00415 unsigned char* dataLocation(int fragmentIndex) const; 00416 00423 unsigned int getFragmentID(int fragmentIndex) const; 00424 00432 unsigned long headerSize() const; 00433 00441 unsigned char* headerLocation() const; 00442 00453 unsigned int copyFragmentsIntoBuffer(std::vector<unsigned char>& buff) const; 00454 00460 std::string outputModuleLabel() const; 00461 00467 uint32_t outputModuleId() const; 00468 00474 std::string topFolderName() const; 00475 00482 DQMKey dqmKey() const; 00483 00489 void hltTriggerNames(Strings& nameList) const; 00490 00496 void hltTriggerSelections(Strings& nameList) const; 00497 00503 void l1TriggerNames(Strings& nameList) const; 00504 00510 uint32_t hltTriggerCount() const; 00511 00519 void hltTriggerBits(std::vector<unsigned char>& bitList) const; 00520 00526 uint32_t runNumber() const; 00527 00533 uint32_t lumiSection() const; 00534 00540 uint32_t eventNumber() const; 00541 00546 uint32_t adler32Checksum() const; 00547 00556 void assertRunNumber(uint32_t runNumber); 00557 00562 bool isEndOfLumiSectionMessage() const; 00563 00564 private: 00565 00566 boost::shared_ptr<detail::ChainData> data_; 00567 }; 00568 00569 } // namespace stor 00570 00571 #endif // EventFilter_StorageManager_I2OChain_h 00572 00573