CMS 3D CMS Logo

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

#include <StreamerInputSource.h>

Inheritance diagram for edm::StreamerInputSource:
edm::RawInputSource edm::InputSource edm::ProductRegistryHelper edm::EventStreamHttpReader edm::StreamerFileReader edm::StreamerInputModule< Producer >

Classes

class  ProductGetter
 

Public Member Functions

void deserializeAndMergeWithRegistry (InitMsgView const &initView, bool subsequent=false)
 
void deserializeEvent (EventMsgView const &eventView)
 
 StreamerInputSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
virtual ~StreamerInputSource ()
 
- Public Member Functions inherited from edm::RawInputSource
 RawInputSource (ParameterSet const &pset, InputSourceDescription const &desc)
 
virtual ~RawInputSource ()
 
- Public Member Functions inherited from edm::InputSource
boost::shared_ptr
< ActivityRegistry
actReg () const
 Accessor for Activity Registry. More...
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper () const
 Accessor for branchIDListHelper. More...
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doBeginLumi (LuminosityBlockPrincipal &lbp)
 Called by framework at beginning of lumi block. More...
 
void doBeginRun (RunPrincipal &rp)
 Called by framework at beginning of run. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void doEndLumi (LuminosityBlockPrincipal &lbp, bool cleaningUpAfterException)
 Called by framework at end of lumi block. More...
 
void doEndRun (RunPrincipal &rp, bool cleaningUpAfterException)
 Called by framework at end of run. More...
 
void doPostForkReacquireResources (boost::shared_ptr< multicore::MessageReceiverForSource >)
 
void doPreForkReleaseResources ()
 Called by the framework before forking the process. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
 InputSource (InputSource const &)=delete
 
void issueReports (EventID const &eventID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
luminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemType nextItemType ()
 
InputSourceoperator= (InputSource const &)=delete
 
bool primary () const
 Accessor for primary input source flag. More...
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 Accessor for product registry. More...
 
bool randomAccess () const
 
boost::shared_ptr
< LuminosityBlockPrincipal
readAndCacheLumi (HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
boost::shared_ptr< RunPrincipalreadAndCacheRun (HistoryAppender &historyAppender)
 Read next run (new run) More...
 
void readAndMergeLumi (boost::shared_ptr< LuminosityBlockPrincipal > lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (boost::shared_ptr< RunPrincipal > rp)
 Read next run (same as a prior run) More...
 
EventPrincipalreadEvent (EventPrincipal &ep)
 
EventPrincipalreadEvent (EventPrincipal &ep, EventID const &)
 Read a specific event. More...
 
std::unique_ptr< FileBlockreadFile ()
 Read next file. More...
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
boost::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
void registerProducts ()
 Register any produced products. More...
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
boost::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
bool skipForForking ()
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource ()
 Destructor. More...
 

Static Public Member Functions

static std::auto_ptr
< SendJobHeader
deserializeRegistry (InitMsgView const &initView)
 
static void fillDescription (ParameterSetDescription &description)
 
static void mergeIntoRegistry (SendJobHeader const &header, ProductRegistry &, BranchIDListHelper &, bool subsequent)
 
static unsigned int uncompressBuffer (unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, unsigned int expectedFullSize)
 
- Static Public Member Functions inherited from edm::RawInputSource
static void fillDescription (ParameterSetDescription &description)
 
- Static Public Member Functions inherited from edm::InputSource
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Protected Member Functions

void resetAfterEndRun ()
 
- Protected Member Functions inherited from edm::RawInputSource
virtual bool checkNextEvent ()=0
 
EventPrincipalmakeEvent (EventPrincipal &eventPrincipal, EventAuxiliary const &eventAuxiliary)
 
void setInputFileTransitionsEachEvent ()
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
boost::shared_ptr
< LuminosityBlockPrincipal >
const 
luminosityBlockPrincipal () const
 
bool newLumi () const
 
bool newRun () const
 
ProductRegistryproductRegistryUpdate () const
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
boost::shared_ptr
< RunPrincipal > const 
runPrincipal () const
 
void setEventCached ()
 Called by the framework to merge or ached() const {return eventCached_;}. More...
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setNewLumi ()
 
void setNewRun ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
virtual void skip (int offset)
 
ItemType state () const
 

Static Protected Member Functions

static void buildClassCache (SendDescs const &descs)
 
static void declareStreamers (SendDescs const &descs)
 

Private Member Functions

virtual EventPrincipalread (EventPrincipal &eventPrincipal)
 
virtual std::unique_ptr
< FileBlock
readFile_ ()
 
virtual void setRun (RunNumber_t r)
 

Private Attributes

bool adjustEventToNewProductRegistry_
 
std::vector< unsigned char > dest_
 
ProductGetter productGetter_
 
std::unique_ptr< SendEventsendEvent_
 
TClass * tc_
 
TBufferFile xbuf_
 

Static Private Attributes

static std::string processName_
 
static unsigned int protocolVersion_
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemType {
  IsInvalid, IsStop, IsFile, IsRun,
  IsLumi, IsEvent, IsRepeat
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Detailed Description

Definition at line 29 of file StreamerInputSource.h.

Constructor & Destructor Documentation

edm::StreamerInputSource::StreamerInputSource ( ParameterSet const &  pset,
InputSourceDescription const &  desc 
)
explicit

Definition at line 48 of file StreamerInputSource.cc.

50  :
51  RawInputSource(pset, desc),
52  tc_(getTClass(typeid(SendEvent))),
54  xbuf_(TBuffer::kRead, init_size),
55  sendEvent_(),
58  }
RawInputSource(ParameterSet const &pset, InputSourceDescription const &desc)
TClass * getTClass(const std::type_info &ti)
Definition: ClassFiller.cc:77
const int init_size
std::unique_ptr< SendEvent > sendEvent_
std::vector< unsigned char > dest_
edm::StreamerInputSource::~StreamerInputSource ( )
virtual

Definition at line 60 of file StreamerInputSource.cc.

60 {}

Member Function Documentation

void edm::StreamerInputSource::buildClassCache ( SendDescs const &  descs)
staticprotected

Definition at line 108 of file StreamerInputSource.cc.

References edm::doBuildRealData(), alignCSCRings::e, FDEBUG, i, AlCaHLTBitMon_QueryRunRegistry::string, and edm::wrappedClassName().

Referenced by mergeIntoRegistry().

108  {
109  SendDescs::const_iterator i(descs.begin()), e(descs.end());
110 
111  for(; i != e; ++i) {
112  //pi->init();
113  std::string const real_name = wrappedClassName(i->className());
114  FDEBUG(6) << "BuildReadData: " << real_name << std::endl;
115  doBuildRealData(real_name);
116  }
117  }
int i
Definition: DBlmapReader.cc:9
void doBuildRealData(const std::string &name)
Definition: ClassFiller.cc:30
#define FDEBUG(lev)
Definition: DebugMacros.h:18
std::string wrappedClassName(std::string const &iFullName)
void edm::StreamerInputSource::declareStreamers ( SendDescs const &  descs)
staticprotected

Definition at line 95 of file StreamerInputSource.cc.

References alignCSCRings::e, FDEBUG, i, edm::loadCap(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::wrappedClassName().

Referenced by mergeIntoRegistry().

95  {
96  SendDescs::const_iterator i(descs.begin()), e(descs.end());
97 
98  for(; i != e; ++i) {
99  //pi->init();
100  std::string const real_name = wrappedClassName(i->className());
101  FDEBUG(6) << "declare: " << real_name << std::endl;
102  loadCap(real_name);
103  }
104  }
int i
Definition: DBlmapReader.cc:9
#define FDEBUG(lev)
Definition: DebugMacros.h:18
std::string wrappedClassName(std::string const &iFullName)
void loadCap(const std::string &name)
Definition: ClassFiller.cc:19
void edm::StreamerInputSource::deserializeAndMergeWithRegistry ( InitMsgView const &  initView,
bool  subsequent = false 
)

Deserializes the specified init message into a SendJobHeader object and merges registries.

Definition at line 172 of file StreamerInputSource.cc.

References adjustEventToNewProductRegistry_, edm::InputSource::branchIDListHelper(), deserializeRegistry(), i, edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), mergeIntoRegistry(), edm::InputSource::productRegistryUpdate(), sd, and edm::ParameterSet::setID().

Referenced by edm::StreamerFileReader::checkNextEvent(), edm::EventStreamHttpReader::readHeader(), edm::StreamerFileReader::reset_(), and edm::StreamerInputModule< Producer >::StreamerInputModule().

172  {
173  std::auto_ptr<SendJobHeader> sd = deserializeRegistry(initView);
174  ProcessConfigurationVector const& pcv = sd->processConfigurations();
176  if (subsequent) {
178  }
179  SendJobHeader::ParameterSetMap const& psetMap = sd->processParameterSet();
180  pset::Registry& psetRegistry = *pset::Registry::instance();
181  for (SendJobHeader::ParameterSetMap::const_iterator i = psetMap.begin(), iEnd = psetMap.end(); i != iEnd; ++i) {
182  ParameterSet pset(i->second.pset());
183  pset.setID(i->first);
184  psetRegistry.insertMapped(pset);
185  }
187  for (ProcessConfigurationVector::const_iterator it = pcv.begin(), itEnd = pcv.end(); it != itEnd; ++it) {
188  pcReg.insertMapped(*it);
189  }
190  }
int i
Definition: DBlmapReader.cc:9
static void mergeIntoRegistry(SendJobHeader const &header, ProductRegistry &, BranchIDListHelper &, bool subsequent)
static ThreadSafeRegistry * instance()
std::map< ParameterSetID, ParameterSetBlob > ParameterSetMap
detail::ThreadSafeRegistry< ParameterSetID, ParameterSet, ProcessParameterSetIDCache > Registry
Definition: Registry.h:37
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
edm::detail::ThreadSafeRegistry< edm::ProcessConfigurationID, edm::ProcessConfiguration > ProcessConfigurationRegistry
boost::shared_ptr< BranchIDListHelper > branchIDListHelper() const
Accessor for branchIDListHelper.
Definition: InputSource.h:165
double sd
ProductRegistry & productRegistryUpdate() const
Definition: InputSource.h:316
static std::auto_ptr< SendJobHeader > deserializeRegistry(InitMsgView const &initView)
void edm::StreamerInputSource::deserializeEvent ( EventMsgView const &  eventView)

Deserializes the specified event message.

Definition at line 196 of file StreamerInputSource.cc.

References cms::Adler32(), EventMsgView::adler32_chksum(), dtNoiseDBValidation_cfg::cerr, EventMsgView::code(), filterCSVwithJSON::copy, dest_, Header::EVENT, EventMsgView::event(), EventMsgView::eventData(), EventMsgView::eventLength(), edm::hlt::Exception, FDEBUG, EventMsgView::hostName(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::Timestamp::invalidTimestamp(), EventMsgView::lumi(), edm::InputSource::luminosityBlock(), edm::InputSource::luminosityBlockAuxiliary(), EventMsgView::origDataSize(), pos, productGetter_, edm::InputSource::resetLuminosityBlockAuxiliary(), EventMsgView::run(), edm::InputSource::run(), edm::InputSource::runAuxiliary(), sendEvent_, edm::InputSource::setEventCached(), edm::InputSource::setLuminosityBlockAuxiliary(), edm::RunAuxiliary::setProcessHistoryID(), edm::LuminosityBlockAuxiliary::setProcessHistoryID(), edm::setRefCoreStreamer(), edm::InputSource::setRunAuxiliary(), EventMsgView::size(), tc_, uncompressBuffer(), and xbuf_.

Referenced by edm::StreamerFileReader::checkNextEvent(), and edm::EventStreamHttpReader::checkNextEvent().

196  {
197  if(eventView.code() != Header::EVENT)
198  throw cms::Exception("StreamTranslation","Event deserialization error")
199  << "received wrong message type: expected EVENT, got "
200  << eventView.code() << "\n";
201  FDEBUG(9) << "Decode event: "
202  << eventView.event() << " "
203  << eventView.run() << " "
204  << eventView.size() << " "
205  << eventView.adler32_chksum() << " "
206  << eventView.eventLength() << " "
207  << eventView.eventData()
208  << std::endl;
209  EventSourceSentry sentry(*this);
210  // uncompress if we need to
211  // 78 was a dummy value (for no uncompressed) - should be 0 for uncompressed
212  // need to get rid of this when 090 MTCC streamers are gotten rid of
213  unsigned long origsize = eventView.origDataSize();
214  unsigned long dest_size; //(should be >= eventView.origDataSize())
215 
216  uint32_t adler32_chksum = cms::Adler32((char*)eventView.eventData(), eventView.eventLength());
217  //std::cout << "Adler32 checksum of event = " << adler32_chksum << std::endl;
218  //std::cout << "Adler32 checksum from header = " << eventView.adler32_chksum() << " "
219  // << "host name = " << eventView.hostName() << " len = " << eventView.hostName_len() << std::endl;
220  if((uint32)adler32_chksum != eventView.adler32_chksum()) {
221  std::cerr << "Error from StreamerInputSource: checksum of event data blob failed "
222  << " chksum from event = " << adler32_chksum << " from header = "
223  << eventView.adler32_chksum() << " host name = " << eventView.hostName() << std::endl;
224  // skip event (based on option?) or throw exception?
225  }
226  if(origsize != 78 && origsize != 0) {
227  // compressed
228  dest_size = uncompressBuffer((unsigned char*)eventView.eventData(),
229  eventView.eventLength(), dest_, origsize);
230  } else { // not compressed
231  // we need to copy anyway the buffer as we are using dest in xbuf
232  dest_size = eventView.eventLength();
233  dest_.resize(dest_size);
234  unsigned char* pos = (unsigned char*) &dest_[0];
235  unsigned char* from = (unsigned char*) eventView.eventData();
236  std::copy(from,from+dest_size,pos);
237  }
238  //TBuffer xbuf(TBuffer::kRead, dest_size,
239  // (char*) &dest[0],kFALSE);
240  //TBuffer xbuf(TBuffer::kRead, eventView.eventLength(),
241  // (char*) eventView.eventData(),kFALSE);
242  xbuf_.Reset();
243  xbuf_.SetBuffer(&dest_[0],dest_size,kFALSE);
244  RootDebug tracer(10,10);
245 
247  sendEvent_ = std::unique_ptr<SendEvent>((SendEvent*)xbuf_.ReadObjectAny(tc_));
249 
250  if(sendEvent_.get()==0) {
251  throw cms::Exception("StreamTranslation","Event deserialization error")
252  << "got a null event from input stream\n";
253  }
255 
256  FDEBUG(5) << "Got event: " << sendEvent_->aux().id() << " " << sendEvent_->products().size() << std::endl;
257  if(runAuxiliary().get() == 0 || runAuxiliary()->run() != sendEvent_->aux().run()) {
258  RunAuxiliary* runAuxiliary = new RunAuxiliary(sendEvent_->aux().run(), sendEvent_->aux().time(), Timestamp::invalidTimestamp());
259  runAuxiliary->setProcessHistoryID(sendEvent_->processHistory().id());
260  setRunAuxiliary(runAuxiliary);
262  }
263  if(!luminosityBlockAuxiliary() || luminosityBlockAuxiliary()->luminosityBlock() != eventView.lumi()) {
264  LuminosityBlockAuxiliary* luminosityBlockAuxiliary =
265  new LuminosityBlockAuxiliary(runAuxiliary()->run(), eventView.lumi(), sendEvent_->aux().time(), Timestamp::invalidTimestamp());
266  luminosityBlockAuxiliary->setProcessHistoryID(sendEvent_->processHistory().id());
267  setLuminosityBlockAuxiliary(luminosityBlockAuxiliary);
268  }
269  setEventCached();
270  }
static ThreadSafeRegistry * instance()
void setRefCoreStreamer(bool resetAll=false)
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:247
RunNumber_t run() const
Accessor for current run number.
Definition: InputSource.cc:605
#define FDEBUG(lev)
Definition: DebugMacros.h:18
bool insertMapped(value_type const &v)
void setLuminosityBlockAuxiliary(LuminosityBlockAuxiliary *lbp)
Definition: InputSource.h:322
std::unique_ptr< SendEvent > sendEvent_
unsigned int uint32
Definition: MsgTools.h:13
void setEventCached()
Called by the framework to merge or ached() const {return eventCached_;}.
Definition: InputSource.h:349
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
LuminosityBlockNumber_t luminosityBlock() const
Accessor for current luminosity block number.
Definition: InputSource.cc:611
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:330
boost::shared_ptr< RunAuxiliary > runAuxiliary() const
Called by the framework to merge or insert run in principal cache.
Definition: InputSource.h:244
void setRunAuxiliary(RunAuxiliary *rp)
Definition: InputSource.h:318
static unsigned int uncompressBuffer(unsigned char *inputBuffer, unsigned int inputSize, std::vector< unsigned char > &outputBuffer, unsigned int expectedFullSize)
std::vector< unsigned char > dest_
std::auto_ptr< SendJobHeader > edm::StreamerInputSource::deserializeRegistry ( InitMsgView const &  initView)
static

Deserializes the specified init message into a SendJobHeader object (which is related to the product registry).

Definition at line 124 of file StreamerInputSource.cc.

References cms::Adler32(), InitMsgView::adler32_chksum(), dtNoiseDBValidation_cfg::cerr, InitMsgView::code(), InitMsgView::descData(), InitMsgView::descLength(), edm::hlt::Exception, FDEBUG, edm::getTClass(), InitMsgView::hostName(), Header::INIT, InitMsgView::processName(), processName_, InitMsgView::protocolVersion(), protocolVersion_, and sd.

Referenced by deserializeAndMergeWithRegistry(), and edm::readHeaderFromStream().

124  {
125  if(initView.code() != Header::INIT)
126  throw cms::Exception("StreamTranslation","Registry deserialization error")
127  << "received wrong message type: expected INIT, got "
128  << initView.code() << "\n";
129 
130  //Get the process name and store if for Protocol version 4 and above.
131  if (initView.protocolVersion() > 3) {
132 
133  processName_ = initView.processName();
134  protocolVersion_ = initView.protocolVersion();
135 
136  FDEBUG(10) << "StreamerInputSource::deserializeRegistry processName = "<< processName_<< std::endl;
137  FDEBUG(10) << "StreamerInputSource::deserializeRegistry protocolVersion_= "<< protocolVersion_<< std::endl;
138  }
139 
140  // calculate the adler32 checksum
141  uint32_t adler32_chksum = cms::Adler32((char*)initView.descData(),initView.descLength());
142  //std::cout << "Adler32 checksum of init message = " << adler32_chksum << std::endl;
143  //std::cout << "Adler32 checksum of init messsage from header = " << initView.adler32_chksum() << " "
144  // << "host name = " << initView.hostName() << " len = " << initView.hostName_len() << std::endl;
145  if((uint32)adler32_chksum != initView.adler32_chksum()) {
146  std::cerr << "Error from StreamerInputSource: checksum of Init registry blob failed "
147  << " chksum from registry data = " << adler32_chksum << " from header = "
148  << initView.adler32_chksum() << " host name = " << initView.hostName() << std::endl;
149  // skip event (based on option?) or throw exception?
150  }
151 
152  TClass* desc = getTClass(typeid(SendJobHeader));
153 
154  TBufferFile xbuf(TBuffer::kRead, initView.descLength(),
155  (char*)initView.descData(),kFALSE);
156  RootDebug tracer(10,10);
157  std::auto_ptr<SendJobHeader> sd((SendJobHeader*)xbuf.ReadObjectAny(desc));
158 
159  if(sd.get()==0) {
160  throw cms::Exception("StreamTranslation","Registry deserialization error")
161  << "Could not read the initial product registry list\n";
162  }
163 
164  return sd;
165  }
static std::string processName_
#define FDEBUG(lev)
Definition: DebugMacros.h:18
TClass * getTClass(const std::type_info &ti)
Definition: ClassFiller.cc:77
static unsigned int protocolVersion_
unsigned int uint32
Definition: MsgTools.h:13
void Adler32(char const *data, size_t len, uint32_t &a, uint32_t &b)
double sd
void edm::StreamerInputSource::fillDescription ( ParameterSetDescription description)
static

Definition at line 397 of file StreamerInputSource.cc.

References edm::RawInputSource::fillDescription().

Referenced by edm::StreamerFileReader::fillDescriptions().

397  {
399  }
static void fillDescription(ParameterSetDescription &description)
void edm::StreamerInputSource::mergeIntoRegistry ( SendJobHeader const &  header,
ProductRegistry reg,
BranchIDListHelper branchIDListHelper,
bool  subsequent 
)
static

Definition at line 69 of file StreamerInputSource.cc.

References edm::SendJobHeader::branchIDLists(), buildClassCache(), declareStreamers(), edm::SendJobHeader::descs(), edm::hlt::Exception, FDEBUG, edm::fillProductRegistryTransients(), edm::loadExtraClasses(), edm::ProductRegistry::merge(), edm::BranchDescription::Permissive, edm::SendJobHeader::processConfigurations(), AlCaHLTBitMon_QueryRunRegistry::string, edm::BranchIDListHelper::updateFromInput(), and edm::ProductRegistry::updateFromInput().

Referenced by deserializeAndMergeWithRegistry(), and edm::getRegFromFile().

69  {
70 
71  SendDescs const& descs = header.descs();
72 
73  FDEBUG(6) << "mergeIntoRegistry: Product List: " << std::endl;
74 
75  if (subsequent) {
76  ProductRegistry pReg;
77  pReg.updateFromInput(descs);
78  fillProductRegistryTransients(header.processConfigurations(), pReg);
79  std::string mergeInfo = reg.merge(pReg, std::string(), BranchDescription::Permissive);
80  if (!mergeInfo.empty()) {
81  throw cms::Exception("MismatchedInput","RootInputFileSequence::previousEvent()") << mergeInfo;
82  }
83  branchIDListHelper.updateFromInput(header.branchIDLists());
84  } else {
85  declareStreamers(descs);
86  buildClassCache(descs);
88  reg.updateFromInput(descs);
89  fillProductRegistryTransients(header.processConfigurations(), reg);
90  branchIDListHelper.updateFromInput(header.branchIDLists());
91  }
92  }
std::vector< BranchDescription > SendDescs
#define FDEBUG(lev)
Definition: DebugMacros.h:18
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
static void declareStreamers(SendDescs const &descs)
static void buildClassCache(SendDescs const &descs)
boost::shared_ptr< BranchIDListHelper > branchIDListHelper() const
Accessor for branchIDListHelper.
Definition: InputSource.h:165
void loadExtraClasses()
Definition: ClassFiller.cc:42
EventPrincipal * edm::StreamerInputSource::read ( EventPrincipal eventPrincipal)
privatevirtual

Implements edm::RawInputSource.

Definition at line 273 of file StreamerInputSource.cc.

References adjustEventToNewProductRegistry_, edm::Principal::adjustIndexesAfterProductRegistryAddition(), edm::Principal::adjustToNewProductRegistry(), edm::InputSource::branchIDListHelper(), FDEBUG, edm::EventPrincipal::fillEventPrincipal(), productGetter_, edm::InputSource::productRegistry(), edm::EventPrincipal::putOnRead(), sendEvent_, edm::StreamerInputSource::ProductGetter::setEventPrincipal(), and edm::Principal::size().

273  {
275  eventPrincipal.adjustIndexesAfterProductRegistryAddition();
276  bool eventOK = eventPrincipal.adjustToNewProductRegistry(*productRegistry());
277  assert(eventOK);
279  }
280  boost::shared_ptr<EventSelectionIDVector> ids(new EventSelectionIDVector(sendEvent_->eventSelectionIDs()));
281  boost::shared_ptr<BranchListIndexes> indexes(new BranchListIndexes(sendEvent_->branchListIndexes()));
282  branchIDListHelper()->fixBranchListIndexes(*indexes);
283  eventPrincipal.fillEventPrincipal(sendEvent_->aux(), ids, indexes);
284  productGetter_.setEventPrincipal(&eventPrincipal);
285 
286  // no process name list handling
287 
288  SendProds & sps = sendEvent_->products();
289  for(SendProds::iterator spi = sps.begin(), spe = sps.end(); spi != spe; ++spi) {
290  FDEBUG(10) << "check prodpair" << std::endl;
291  if(spi->desc() == 0)
292  throw cms::Exception("StreamTranslation","Empty Provenance");
293  FDEBUG(5) << "Prov:"
294  << " " << spi->desc()->className()
295  << " " << spi->desc()->productInstanceName()
296  << " " << spi->desc()->branchID()
297  << std::endl;
298 
299  ConstBranchDescription branchDesc(*spi->desc());
300  // This ProductProvenance constructor inserts into the entry description registry
301  ProductProvenance productProvenance(spi->branchID(), *spi->parents());
302 
303  if(spi->prod() != 0) {
304  FDEBUG(10) << "addproduct next " << spi->branchID() << std::endl;
305  eventPrincipal.putOnRead(branchDesc, spi->prod(), productProvenance);
306  FDEBUG(10) << "addproduct done" << std::endl;
307  } else {
308  FDEBUG(10) << "addproduct empty next " << spi->branchID() << std::endl;
309  eventPrincipal.putOnRead(branchDesc, spi->prod(), productProvenance);
310  FDEBUG(10) << "addproduct empty done" << std::endl;
311  }
312  spi->clear();
313  }
314 
315  FDEBUG(10) << "Size = " << eventPrincipal.size() << std::endl;
316 
317  return &eventPrincipal;
318  }
#define FDEBUG(lev)
Definition: DebugMacros.h:18
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< BranchListIndex > BranchListIndexes
boost::shared_ptr< BranchIDListHelper > branchIDListHelper() const
Accessor for branchIDListHelper.
Definition: InputSource.h:165
std::unique_ptr< SendEvent > sendEvent_
std::vector< StreamedProduct > SendProds
boost::shared_ptr< ProductRegistry const > productRegistry() const
Accessor for product registry.
Definition: InputSource.h:162
std::unique_ptr< FileBlock > edm::StreamerInputSource::readFile_ ( )
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 64 of file StreamerInputSource.cc.

64  {
65  return std::unique_ptr<FileBlock>(new FileBlock);
66  }
void edm::StreamerInputSource::resetAfterEndRun ( )
protected

Definition at line 364 of file StreamerInputSource.cc.

References edm::InputSource::eventCached(), edm::InputSource::reset(), edm::InputSource::resetLuminosityBlockAuxiliary(), and edm::InputSource::resetRunAuxiliary().

364  {
365  // called from an online streamer source to reset after a stop command
366  // so an enable command will work
369  assert(!eventCached());
370  reset();
371  }
void resetRunAuxiliary(bool isNewRun=true) const
Definition: InputSource.h:326
void resetLuminosityBlockAuxiliary(bool isNewLumi=true) const
Definition: InputSource.h:330
void reset() const
Definition: InputSource.h:334
bool eventCached() const
Definition: InputSource.h:347
void edm::StreamerInputSource::setRun ( RunNumber_t  r)
privatevirtual

Reimplemented from edm::InputSource.

Definition at line 373 of file StreamerInputSource.cc.

References edm::hlt::Exception, and edm::errors::LogicError.

373  {
374  // Need to define a dummy setRun here or else the InputSource::setRun is called
375  // if we have a source inheriting from this and wants to define a setRun method
377  << "StreamerInputSource::setRun()\n"
378  << "Run number cannot be modified for this type of Input Source\n"
379  << "Contact a Storage Manager Developer\n";
380  }
unsigned int edm::StreamerInputSource::uncompressBuffer ( unsigned char *  inputBuffer,
unsigned int  inputSize,
std::vector< unsigned char > &  outputBuffer,
unsigned int  expectedFullSize 
)
static

Uncompresses the data in the specified input buffer into the specified output buffer. The inputSize should be set to the size of the compressed data in the inputBuffer. The expectedFullSize should be set to the original size of the data (before compression). Returns the actual size of the uncompressed data. Errors are reported by throwing exceptions.

Definition at line 329 of file StreamerInputSource.cc.

References dtNoiseDBValidation_cfg::cerr, edm::hlt::Exception, FDEBUG, and run_regression::ret.

Referenced by edm::StreamDQMDeserializer::deserializeDQMEvent(), and deserializeEvent().

332  {
333  unsigned long origSize = expectedFullSize;
334  unsigned long uncompressedSize = expectedFullSize*1.1;
335  FDEBUG(1) << "Uncompress: original size = " << origSize
336  << ", compressed size = " << inputSize
337  << std::endl;
338  outputBuffer.resize(uncompressedSize);
339  int ret = uncompress(&outputBuffer[0], &uncompressedSize,
340  inputBuffer, inputSize); // do not need compression level
341  //std::cout << "unCompress Return value: " << ret << " Okay = " << Z_OK << std::endl;
342  if(ret == Z_OK) {
343  // check the length against original uncompressed length
344  FDEBUG(10) << " original size = " << origSize << " final size = "
345  << uncompressedSize << std::endl;
346  if(origSize != uncompressedSize) {
347  std::cerr << "deserializeEvent: Problem with uncompress, original size = "
348  << origSize << " uncompress size = " << uncompressedSize << std::endl;
349  // we throw an error and return without event! null pointer
350  throw cms::Exception("StreamDeserialization","Uncompression error")
351  << "mismatch event lengths should be" << origSize << " got "
352  << uncompressedSize << "\n";
353  }
354  } else {
355  // we throw an error and return without event! null pointer
356  std::cerr << "deserializeEvent: Problem with uncompress, return value = "
357  << ret << std::endl;
358  throw cms::Exception("StreamDeserialization","Uncompression error")
359  << "Error code = " << ret << "\n ";
360  }
361  return (unsigned int) uncompressedSize;
362  }
#define FDEBUG(lev)
Definition: DebugMacros.h:18

Member Data Documentation

bool edm::StreamerInputSource::adjustEventToNewProductRegistry_
private

Definition at line 90 of file StreamerInputSource.h.

Referenced by deserializeAndMergeWithRegistry(), and read().

std::vector<unsigned char> edm::StreamerInputSource::dest_
private

Definition at line 86 of file StreamerInputSource.h.

Referenced by deserializeEvent().

std::string edm::StreamerInputSource::processName_
staticprivate

Definition at line 93 of file StreamerInputSource.h.

Referenced by deserializeRegistry().

ProductGetter edm::StreamerInputSource::productGetter_
private

Definition at line 89 of file StreamerInputSource.h.

Referenced by deserializeEvent(), and read().

unsigned int edm::StreamerInputSource::protocolVersion_
staticprivate

Definition at line 94 of file StreamerInputSource.h.

Referenced by deserializeRegistry().

std::unique_ptr<SendEvent> edm::StreamerInputSource::sendEvent_
private

Definition at line 88 of file StreamerInputSource.h.

Referenced by deserializeEvent(), and read().

TClass* edm::StreamerInputSource::tc_
private

Definition at line 85 of file StreamerInputSource.h.

Referenced by deserializeEvent().

TBufferFile edm::StreamerInputSource::xbuf_
private

Definition at line 87 of file StreamerInputSource.h.

Referenced by deserializeEvent().