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 edm::EDConsumerBase

Public Member Functions

 FRDEventOutputModule (edm::ParameterSet const &ps)
 
 ~FRDEventOutputModule ()
 
- Public Member Functions inherited from edm::OutputModule
BranchChildren const & branchChildren () const
 
BranchIDLists const * branchIDLists () const
 
std::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
SelectedProductsForBranchType
const & 
keptProducts () const
 
int maxEvents () const
 
OutputModuleoperator= (OutputModule const &)=delete
 
 OutputModule (ParameterSet const &pset)
 
 OutputModule (OutputModule const &)=delete
 
std::string const & processName () const
 
int remainingEvents () const
 
bool selected (BranchDescription const &desc) const
 
void selectProducts (ProductRegistry const &preg)
 
bool wantAllEvents () const
 
virtual ~OutputModule ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef unsigned int uint32
 

Private Member Functions

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

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
 
- 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
void configure (OutputModuleDescription const &desc)
 
ModuleDescription const & description () const
 
void doBeginJob ()
 
bool doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
 
bool doBeginRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
 
void doEndJob ()
 
bool doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *mcc)
 
bool doEndRun (RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *mcc)
 
bool doEvent (EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *act, ModuleCallingContext const *mcc)
 
void doPreallocate (PreallocationConfiguration const &)
 
std::map< BranchID::value_type,
BranchID::value_type > const & 
droppedBranchIDToKeptBranchID ()
 
Trig getTriggerResults (EventPrincipal const &ep, ModuleCallingContext const *) const
 
ModuleDescription const & moduleDescription () const
 
ParameterSetID selectorConfig () const
 
void setEventSelectionInfo (std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<class Consumer>
class FRDEventOutputModule< Consumer >

Definition at line 22 of file FRDEventOutputModule.h.

Member Typedef Documentation

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

Definition at line 24 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 49 of file FRDEventOutputModule.h.

49  :
51  templateConsumer_(new Consumer(ps)),
52  label_(ps.getUntrackedParameter<std::string>("ProductLabel","source")),
53  instance_(ps.getUntrackedParameter<std::string>("ProductInstance",""))
54 {
55 }
std::auto_ptr< Consumer > templateConsumer_
template<class Consumer >
FRDEventOutputModule< Consumer >::~FRDEventOutputModule ( )

Definition at line 58 of file FRDEventOutputModule.h.

58 {}

Member Function Documentation

template<class Consumer >
void FRDEventOutputModule< Consumer >::beginRun ( edm::RunPrincipal const &  ,
edm::ModuleCallingContext const *   
)
overrideprivatevirtual

Reimplemented from edm::OutputModule.

Definition at line 111 of file FRDEventOutputModule.h.

112 {
113  templateConsumer_->start();
114 }
std::auto_ptr< Consumer > templateConsumer_
template<class Consumer >
void FRDEventOutputModule< Consumer >::endRun ( edm::RunPrincipal const &  ,
edm::ModuleCallingContext const *   
)
overrideprivatevirtual

Reimplemented from edm::OutputModule.

Definition at line 117 of file FRDEventOutputModule.h.

118 {
119  templateConsumer_->stop();
120 }
std::auto_ptr< Consumer > templateConsumer_
template<class Consumer >
void FRDEventOutputModule< Consumer >::write ( edm::EventPrincipal const &  e,
edm::ModuleCallingContext const *  mcc 
)
overrideprivatevirtual

Implements edm::OutputModule.

Definition at line 61 of file FRDEventOutputModule.h.

References edm::convert_handle(), FEDRawData::data(), archive::emptyString, edm::EventID::event(), edm::Principal::getByLabel(), h, edm::EventPrincipal::id(), customizeTrackingMonitorSeedNumber::idx, edm::EventPrincipal::luminosityBlock(), producerFileCleanner::msg, edm::PRODUCT_TYPE, edm::EventPrincipal::run(), FEDRawData::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

61  {
62 
63  static const edm::TypeID fedType(typeid(FEDRawDataCollection));
64  static const std::string emptyString("");
65 
68  fedType,
69  label_,
70  instance_,
72  nullptr,
73  mcc);
74  convert_handle(std::move(h), fedBuffers);
75 
76  // determine the expected size of the FRDEvent
77  int expectedSize = (4 + 1024) * sizeof(uint32);
78  for (int idx = 0; idx < 1024; ++idx) {
79  FEDRawData singleFED = fedBuffers->FEDData(idx);
80  expectedSize += singleFED.size();
81  //if (singleFED.size() > 0) {
82  // std::cout << "FED #" << idx << " size = " << singleFED.size() << std::endl;
83  //}
84  }
85 
86  // build the FRDEvent into a temporary buffer
87  boost::shared_array<unsigned char> workBuffer(new unsigned char[expectedSize + 256]);
88  uint32 *bufPtr = (uint32*) workBuffer.get();
89  *bufPtr++ = (uint32) 2; // version number
90  *bufPtr++ = (uint32) e.run();
91  *bufPtr++ = (uint32) e.luminosityBlock();
92  *bufPtr++ = (uint32) e.id().event();
93  for (int idx = 0; idx < 1024; ++idx) {
94  FEDRawData singleFED = fedBuffers->FEDData(idx);
95  *bufPtr++ = singleFED.size();
96  }
97  for (int idx = 0; idx < 1024; ++idx) {
98  FEDRawData singleFED = fedBuffers->FEDData(idx);
99  if (singleFED.size() > 0) {
100  memcpy(bufPtr, singleFED.data(), singleFED.size());
101  *bufPtr += singleFED.size();
102  }
103  }
104 
105  // create the FRDEventMsgView and use the template consumer to write it out
106  FRDEventMsgView msg(workBuffer.get());
107  templateConsumer_->doOutputEvent(msg);
108 }
string emptyString
Definition: archive.py:29
std::auto_ptr< Consumer > templateConsumer_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
unsigned int uint32
Definition: MsgTools.h:13
void convert_handle(BasicHandle &&bh, Handle< T > &result)
Definition: ConvertHandle.h:20
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
template<class Consumer >
virtual void FRDEventOutputModule< Consumer >::writeLuminosityBlock ( edm::LuminosityBlockPrincipal const &  ,
edm::ModuleCallingContext const *   
)
inlineoverrideprivatevirtual

Implements edm::OutputModule.

Definition at line 41 of file FRDEventOutputModule.h.

41 {}
template<class Consumer >
virtual void FRDEventOutputModule< Consumer >::writeRun ( edm::RunPrincipal const &  ,
edm::ModuleCallingContext const *   
)
inlineoverrideprivatevirtual

Implements edm::OutputModule.

Definition at line 40 of file FRDEventOutputModule.h.

40 {}

Member Data Documentation

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

Definition at line 45 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 43 of file FRDEventOutputModule.h.