CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FaultyEventStreamHandler.cc
Go to the documentation of this file.
1 // $Id: FaultyEventStreamHandler.cc,v 1.6 2012/10/17 10:13:25 mommsen Exp $
3 
5 
11 
12 
13 namespace stor {
14 
16  (
17  const SharedResourcesPtr sharedResources,
18  const DbFileHandlerPtr dbFileHandler,
19  const std::string& streamName
20  ):
21  StreamHandler(sharedResources, dbFileHandler),
22  initMsgCollection_(sharedResources->initMsgCollection_)
23  {
24  streamRecord_->streamName = streamName;
25  streamRecord_->fractionToDisk = 1;
26  }
27 
28 
31  {
32  // In the faulty event stream a new file is opened for each event.
33  closeAllFiles();
34  return newFileHandler(event);
35  }
36 
37 
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  }
75 
76 } // namespace stor
77 
boost::shared_ptr< SharedResources > SharedResourcesPtr
boost::shared_ptr< InitMsgBuffer > InitMsgSharedPtr
const DbFileHandlerPtr dbFileHandler_
boost::shared_ptr< FileRecord > FileRecordPtr
virtual FileHandlerPtr getFileHandler(const I2OChain &event)
boost::shared_ptr< DbFileHandler > DbFileHandlerPtr
Definition: DbFileHandler.h:71
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)
FaultyEventStreamHandler(const SharedResourcesPtr, const DbFileHandlerPtr, const std::string &streamName)
virtual double fractionToDisk() const =0
uint32_t outputModuleId() const
Definition: I2OChain.cc:505