Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

io::EmptyEventHandle Class Reference

A dummy event handle to provide an infinite stream of empty events. More...

#include <EmptyEventHandle.h>

Inheritance diagram for io::EmptyEventHandle:

io::EventHandle edm::EventHandle List of all members.

Public Member Functions

 EmptyEventHandle (const char *fname)
 EmptyEventHandle ()
virtual ~EmptyEventHandle ()
int SetupInputFile (const char *fname)
virtual int SetupInputFile (TFile *)
virtual int Advance (int)
virtual int Rewind (int)
virtual int Load (int)

Detailed Description

A dummy event handle to provide an infinite stream of empty events.

Definition at line 18 of file EmptyEventHandle.h.


Constructor & Destructor Documentation

EmptyEventHandle::EmptyEventHandle const char *  fname  ) 
 

Definition at line 17 of file EmptyEventHandle.cxx.

00017                                                 : io::EventHandle()
00018 {
00019   int run;
00020   int subrun;
00021   int event;
00022   int nread;
00023   nread = sscanf(f,"/dev/null/%d/%d/%d",&run,&subrun,&event);
00024   
00025   if      (nread==3) {           /* no op. */ } // AOK - nothing to do
00026   else if (nread==2) {             event = 0; } // Default event
00027   else if (nread==1) { subrun = 0; event = 0; } // Default subrun/event
00028   else {
00029     std::cerr << "Must supply run/subrun/event numbers using format:\n"
00030               << "  /dev/null/[run]/[subrun]/[event]\n"
00031               << "For example: /dev/null/12350/10/0" << std::endl; 
00032     std::exit(1);
00033   }
00034   fEvent->fHeader->SetRun(run);
00035   fEvent->fHeader->SetSubrun(subrun);
00036   fEvent->fHeader->SetEvent(event);
00037 }

io::EmptyEventHandle::EmptyEventHandle  )  [inline]
 

Definition at line 21 of file EmptyEventHandle.h.

00021 { }

virtual io::EmptyEventHandle::~EmptyEventHandle  )  [inline, virtual]
 

Definition at line 22 of file EmptyEventHandle.h.

00022 { }


Member Function Documentation

int EmptyEventHandle::Advance int   )  [virtual]
 

Reimplemented from io::EventHandle.

Definition at line 41 of file EmptyEventHandle.cxx.

00042 {
00043   fEvent->Clear();
00044   fEvent->fHeader->SetEvent(fEvent->fHeader->Event()+1);
00045   return 1;
00046 }

int EmptyEventHandle::Load int   )  [virtual]
 

Definition at line 13 of file EmptyEventHandle.cxx.

00013 { return 1; }

int EmptyEventHandle::Rewind int   )  [virtual]
 

Reimplemented from io::EventHandle.

Definition at line 12 of file EmptyEventHandle.cxx.

00012 { return 0; }

int EmptyEventHandle::SetupInputFile TFile *   )  [virtual]
 

Reimplemented from io::EventHandle.

Definition at line 11 of file EmptyEventHandle.cxx.

00011 { return 1; }

int io::EmptyEventHandle::SetupInputFile const char *  fname  ) 
 


The documentation for this class was generated from the following files:
Generated on Sun Nov 22 04:45:31 2009 for NOvA Offline by  doxygen 1.3.9.1