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 Types | Private Member Functions | Private Attributes
FRDEventOutputModule< Consumer > Class Template Reference

#include <FRDEventOutputModule.h>

Inheritance diagram for FRDEventOutputModule< Consumer >:
edm::OutputModule

Public Member Functions

 FRDEventOutputModule (edm::ParameterSet const &ps)
 
 ~FRDEventOutputModule ()
 
- Public Member Functions inherited from edm::OutputModule
BranchChildren const & branchChildren () const
 
boost::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
SelectionsArray const & keptProducts () const
 
int maxEvents () const
 
 OutputModule (ParameterSet const &pset)
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts ()
 
bool wantAllEvents () const
 
virtual ~OutputModule ()
 

Private Types

typedef unsigned int uint32
 

Private Member Functions

virtual void beginRun (edm::RunPrincipal const &)
 
virtual void endRun (edm::RunPrincipal const &)
 
virtual void write (edm::EventPrincipal const &e)
 
virtual void writeLuminosityBlock (edm::LuminosityBlockPrincipal const &)
 
virtual void writeRun (edm::RunPrincipal const &)
 

Private Attributes

std::string instance_
 
std::string label_
 
std::auto_ptr< Consumer > templateConsumer_
 

Additional Inherited Members

- Public Types inherited from edm::OutputModule
typedef OutputModule ModuleType
 
typedef OutputWorker WorkerType
 
- Static Public Member Functions inherited from edm::OutputModule
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::OutputModule
CurrentProcessingContext const * currentContext () const
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, CurrentProcessingContext const *cpc)
 
Trig getTriggerResults (Event const &ep) const
 
Trig getTriggerResults (EventPrincipal const &ep) const
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
 

Detailed Description

template<class Consumer>
class FRDEventOutputModule< Consumer >

Definition at line 13 of file FRDEventOutputModule.h.

Member Typedef Documentation

template<class Consumer >
typedef unsigned int FRDEventOutputModule< Consumer >::uint32
private

Definition at line 15 of file FRDEventOutputModule.h.

Constructor & Destructor Documentation

template<class Consumer >
FRDEventOutputModule< Consumer >::FRDEventOutputModule ( edm::ParameterSet const &  ps)
explicit

Consumers are suppose to provide: void doOutputEvent(const FRDEventMsgView& msg) void start() void stop()

Definition at line 40 of file FRDEventOutputModule.h.

40  :
42  templateConsumer_(new Consumer(ps)),
43  label_(ps.getUntrackedParameter<std::string>("ProductLabel","source")),
44  instance_(ps.getUntrackedParameter<std::string>("ProductInstance",""))
45 {
46 }
std::auto_ptr< Consumer > templateConsumer_
template<class Consumer >
FRDEventOutputModule< Consumer >::~FRDEventOutputModule ( )

Definition at line 49 of file FRDEventOutputModule.h.

49 {}

Member Function Documentation

template<class Consumer >
void FRDEventOutputModule< Consumer >::beginRun ( edm::RunPrincipal const &  )
privatevirtual

Reimplemented from edm::OutputModule.

Definition at line 95 of file FRDEventOutputModule.h.

96 {
97  templateConsumer_->start();
98 }
std::auto_ptr< Consumer > templateConsumer_
template<class Consumer >
void FRDEventOutputModule< Consumer >::endRun ( edm::RunPrincipal const &  )
privatevirtual

Reimplemented from edm::OutputModule.

Definition at line 101 of file FRDEventOutputModule.h.

102 {
103  templateConsumer_->stop();
104 }
std::auto_ptr< Consumer > templateConsumer_
template<class Consumer >
void FRDEventOutputModule< Consumer >::write ( edm::EventPrincipal const &  e)
privatevirtual

Implements edm::OutputModule.

Definition at line 52 of file FRDEventOutputModule.h.

References FEDRawData::data(), idDealer::description, edm::EventID::event(), event(), edm::EventBase::id(), edm::EventBase::luminosityBlock(), lumiQueryAPI::msg, edm::EventID::run(), and FEDRawData::size().

52  {
53 
54  // serialize the FEDRawDataCollection into the format that we expect for
55  // FRDEventMsgView objects (may be better ways to do this)
56  edm::Event event(const_cast<edm::EventPrincipal&>(e), description());
58  event.getByLabel(label_, instance_, fedBuffers);
59 
60  // determine the expected size of the FRDEvent
61  int expectedSize = (4 + 1024) * sizeof(uint32);
62  for (int idx = 0; idx < 1024; ++idx) {
63  FEDRawData singleFED = fedBuffers->FEDData(idx);
64  expectedSize += singleFED.size();
65  //if (singleFED.size() > 0) {
66  // std::cout << "FED #" << idx << " size = " << singleFED.size() << std::endl;
67  //}
68  }
69 
70  // build the FRDEvent into a temporary buffer
71  boost::shared_array<unsigned char> workBuffer(new unsigned char[expectedSize + 256]);
72  uint32 *bufPtr = (uint32*) workBuffer.get();
73  *bufPtr++ = (uint32) 2; // version number
74  *bufPtr++ = (uint32) event.id().run();
75  *bufPtr++ = (uint32) event.luminosityBlock();
76  *bufPtr++ = (uint32) event.id().event();
77  for (int idx = 0; idx < 1024; ++idx) {
78  FEDRawData singleFED = fedBuffers->FEDData(idx);
79  *bufPtr++ = singleFED.size();
80  }
81  for (int idx = 0; idx < 1024; ++idx) {
82  FEDRawData singleFED = fedBuffers->FEDData(idx);
83  if (singleFED.size() > 0) {
84  memcpy(bufPtr, singleFED.data(), singleFED.size());
85  *bufPtr += singleFED.size();
86  }
87  }
88 
89  // create the FRDEventMsgView and use the template consumer to write it out
90  FRDEventMsgView msg(workBuffer.get());
91  templateConsumer_->doOutputEvent(msg);
92 }
std::auto_ptr< Consumer > templateConsumer_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
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
unsigned int uint32
Definition: MsgTools.h:13
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
ModuleDescription const & description() const
template<class Consumer >
virtual void FRDEventOutputModule< Consumer >::writeLuminosityBlock ( edm::LuminosityBlockPrincipal const &  )
inlineprivatevirtual

Implements edm::OutputModule.

Definition at line 32 of file FRDEventOutputModule.h.

32 {}
template<class Consumer >
virtual void FRDEventOutputModule< Consumer >::writeRun ( edm::RunPrincipal const &  )
inlineprivatevirtual

Implements edm::OutputModule.

Definition at line 31 of file FRDEventOutputModule.h.

31 {}

Member Data Documentation

template<class Consumer >
std::string FRDEventOutputModule< Consumer >::instance_
private

Definition at line 36 of file FRDEventOutputModule.h.

template<class Consumer >
std::string FRDEventOutputModule< Consumer >::label_
private
template<class Consumer >
std::auto_ptr<Consumer> FRDEventOutputModule< Consumer >::templateConsumer_
private

Definition at line 34 of file FRDEventOutputModule.h.