CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
stor::FaultyEventStreamHandler Class Reference

#include <FaultyEventStreamHandler.h>

Inheritance diagram for stor::FaultyEventStreamHandler:
stor::StreamHandler

Public Member Functions

 FaultyEventStreamHandler (const SharedResourcesPtr, const DbFileHandlerPtr, const std::string &streamName)
 
- Public Member Functions inherited from stor::StreamHandler
void closeAllFiles ()
 
bool closeFilesForLumiSection (const uint32_t &lumiSection, std::string &)
 
void closeTimedOutFiles (utils::TimePoint_t currentTime=utils::getCurrentTime())
 
 StreamHandler (const SharedResourcesPtr, const DbFileHandlerPtr)
 
void writeEvent (const I2OChain &event)
 
virtual ~StreamHandler ()
 

Private Member Functions

virtual double fractionToDisk () const
 
virtual FileHandlerPtr getFileHandler (const I2OChain &event)
 
virtual int getStreamMaxFileSize () const
 
virtual FileHandlerPtr newFileHandler (const I2OChain &event)
 
virtual std::string streamLabel () const
 

Private Attributes

InitMsgCollectionPtr initMsgCollection_
 

Additional Inherited Members

- Protected Types inherited from stor::StreamHandler
typedef std::map< std::string,
unsigned int > 
CoreFileNamesMap
 
typedef boost::shared_ptr
< FileHandler
FileHandlerPtr
 
typedef std::vector
< FileHandlerPtr
FileHandlers
 
- Protected Member Functions inherited from stor::StreamHandler
unsigned long long getMaxFileSize () const
 
FilesMonitorCollection::FileRecordPtr getNewFileRecord (const I2OChain &event)
 
- Protected Attributes inherited from stor::StreamHandler
const DbFileHandlerPtr dbFileHandler_
 
const DiskWritingParamsdiskWritingParams_
 
FileHandlers fileHandlers_
 
const SharedResourcesPtr sharedResources_
 
const StatisticsReporterPtr statReporter_
 
const
StreamsMonitorCollection::StreamRecordPtr 
streamRecord_
 
CoreFileNamesMap usedCoreFileNames_
 

Detailed Description

Handle the faulty event stream written to disk.

Author:
mommsen
Revision:
1.2
Date:
2011/03/07 15:31:31

Definition at line 26 of file FaultyEventStreamHandler.h.

Constructor & Destructor Documentation

stor::FaultyEventStreamHandler::FaultyEventStreamHandler ( const SharedResourcesPtr  sharedResources,
const DbFileHandlerPtr  dbFileHandler,
const std::string &  streamName 
)

Definition at line 16 of file FaultyEventStreamHandler.cc.

References stor::StreamHandler::fractionToDisk().

20  :
21  StreamHandler(sharedResources, dbFileHandler),
22  initMsgCollection_(sharedResources->initMsgCollection_)
23  {
24  streamRecord_->streamName = streamName;
25  streamRecord_->fractionToDisk = 1;
26  }
StreamHandler(const SharedResourcesPtr, const DbFileHandlerPtr)
const StreamsMonitorCollection::StreamRecordPtr streamRecord_

Member Function Documentation

virtual double stor::FaultyEventStreamHandler::fractionToDisk ( ) const
inlineprivatevirtual

Return the fraction-to-disk parameter

Implements stor::StreamHandler.

Definition at line 49 of file FaultyEventStreamHandler.h.

References stor::StreamHandler::streamRecord_.

50  { return streamRecord_->fractionToDisk; }
const StreamsMonitorCollection::StreamRecordPtr streamRecord_
StreamHandler::FileHandlerPtr stor::FaultyEventStreamHandler::getFileHandler ( const I2OChain event)
privatevirtual

Get the file handler responsible for the event

Reimplemented from stor::StreamHandler.

Definition at line 30 of file FaultyEventStreamHandler.cc.

References stor::StreamHandler::closeAllFiles(), and newFileHandler().

31  {
32  // In the faulty event stream a new file is opened for each event.
33  closeAllFiles();
34  return newFileHandler(event);
35  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual FileHandlerPtr newFileHandler(const I2OChain &event)
virtual int stor::FaultyEventStreamHandler::getStreamMaxFileSize ( ) const
inlineprivatevirtual

Return the maximum file size for the stream in MB

Implements stor::StreamHandler.

Definition at line 65 of file FaultyEventStreamHandler.h.

66  { return 0; }
StreamHandler::FileHandlerPtr stor::FaultyEventStreamHandler::newFileHandler ( const I2OChain event)
privatevirtual

Return a new file handler for the provided event

Implements stor::StreamHandler.

Definition at line 39 of file FaultyEventStreamHandler.cc.

References stor::StreamHandler::dbFileHandler_, alignCSCRings::e, stor::StreamHandler::fileHandlers_, stor::StreamHandler::getNewFileRecord(), initMsgCollection_, stor::I2OChain::outputModuleId(), and stor::StreamHandler::streamRecord_.

Referenced by getFileHandler().

40  {
43 
44  // As each event can have a different outputModuleId, we need to
45  // determine the init msg for each event.
46  // If this is not possible, use the FRD data format.
47  try
48  {
49  InitMsgSharedPtr initMsgView =
50  initMsgCollection_->getElementForOutputModuleId( event.outputModuleId() );
51 
52  newFileHandler.reset(
53  new EventFileHandler(initMsgView, fileRecord, dbFileHandler_, 0)
54  );
55  }
56  catch (stor::exception::IncompleteEventMessage& e) //faulty data event
57  {
58  newFileHandler.reset(
59  new FRDFileHandler(fileRecord, dbFileHandler_, 0)
60  );
61  }
62  catch (stor::exception::WrongI2OMessageType& e) //faulty error event
63  {
64  newFileHandler.reset(
65  new FRDFileHandler(fileRecord, dbFileHandler_, 0)
66  );
67  }
68 
69  fileHandlers_.push_back(newFileHandler);
70 
71  streamRecord_->incrementFileCount(fileRecord->lumiSection);
72 
73  return newFileHandler;
74  }
boost::shared_ptr< InitMsgBuffer > InitMsgSharedPtr
const DbFileHandlerPtr dbFileHandler_
boost::shared_ptr< FileRecord > FileRecordPtr
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
FilesMonitorCollection::FileRecordPtr getNewFileRecord(const I2OChain &event)
const StreamsMonitorCollection::StreamRecordPtr streamRecord_
FileHandlers fileHandlers_
boost::shared_ptr< FileHandler > FileHandlerPtr
Definition: StreamHandler.h:67
virtual FileHandlerPtr newFileHandler(const I2OChain &event)
virtual std::string stor::FaultyEventStreamHandler::streamLabel ( ) const
inlineprivatevirtual

Return the stream label

Implements stor::StreamHandler.

Definition at line 43 of file FaultyEventStreamHandler.h.

References stor::StreamHandler::streamRecord_.

44  { return streamRecord_->streamName; }
const StreamsMonitorCollection::StreamRecordPtr streamRecord_

Member Data Documentation

InitMsgCollectionPtr stor::FaultyEventStreamHandler::initMsgCollection_
private

Definition at line 69 of file FaultyEventStreamHandler.h.

Referenced by newFileHandler().