CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/FWCore/Framework/src/EDProducer.cc

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------
00002   
00003 
00004 ----------------------------------------------------------------------*/
00005 
00006 #include "FWCore/Framework/interface/EDProducer.h"
00007 #include "FWCore/Framework/src/CPCSentry.h"
00008 #include "FWCore/Framework/interface/Event.h"
00009 #include "FWCore/Framework/interface/LuminosityBlock.h"
00010 #include "FWCore/Framework/interface/Run.h"
00011 
00012 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
00013 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
00014 
00015 namespace edm {
00016   EDProducer::EDProducer() :
00017       ProducerBase(),
00018       moduleDescription_(),
00019       current_context_(0),
00020       previousParentage_(),
00021       previousParentageId_() { }
00022 
00023   EDProducer::~EDProducer() { }
00024 
00025   bool
00026   EDProducer::doEvent(EventPrincipal& ep, EventSetup const& c,
00027                              CurrentProcessingContext const* cpc) {
00028     detail::CPCSentry sentry(current_context_, cpc);
00029     Event e(ep, moduleDescription_);
00030     this->produce(e, c);
00031     e.commit_(&previousParentage_, &previousParentageId_);
00032     return true;
00033   }
00034 
00035   void 
00036   EDProducer::doBeginJob() {
00037     this->beginJob();
00038   }
00039   
00040   void 
00041   EDProducer::doEndJob() {
00042     this->endJob();
00043   }
00044 
00045   bool
00046   EDProducer::doBeginRun(RunPrincipal& rp, EventSetup const& c,
00047                         CurrentProcessingContext const* cpc) {
00048     detail::CPCSentry sentry(current_context_, cpc);
00049     Run r(rp, moduleDescription_);
00050     this->beginRun(r, c);
00051     r.commit_();
00052     return true;
00053   }
00054 
00055   bool
00056   EDProducer::doEndRun(RunPrincipal& rp, EventSetup const& c,
00057                         CurrentProcessingContext const* cpc) {
00058     detail::CPCSentry sentry(current_context_, cpc);
00059     Run r(rp, moduleDescription_);
00060     this->endRun(r, c);
00061     r.commit_();
00062     return true;
00063   }
00064 
00065   bool
00066   EDProducer::doBeginLuminosityBlock(LuminosityBlockPrincipal& lbp, EventSetup const& c,
00067                         CurrentProcessingContext const* cpc) {
00068     detail::CPCSentry sentry(current_context_, cpc);
00069     LuminosityBlock lb(lbp, moduleDescription_);
00070     this->beginLuminosityBlock(lb, c);
00071     lb.commit_();
00072     return true;
00073   }
00074 
00075   bool
00076   EDProducer::doEndLuminosityBlock(LuminosityBlockPrincipal& lbp, EventSetup const& c,
00077                         CurrentProcessingContext const* cpc) {
00078     detail::CPCSentry sentry(current_context_, cpc);
00079     LuminosityBlock lb(lbp, moduleDescription_);
00080     this->endLuminosityBlock(lb, c);
00081     lb.commit_();
00082     return true;
00083   }
00084 
00085   void
00086   EDProducer::doRespondToOpenInputFile(FileBlock const& fb) {
00087     respondToOpenInputFile(fb);
00088   }
00089 
00090   void
00091   EDProducer::doRespondToCloseInputFile(FileBlock const& fb) {
00092     respondToCloseInputFile(fb);
00093   }
00094 
00095   void 
00096   EDProducer::doRespondToOpenOutputFiles(FileBlock const& fb) {
00097     respondToOpenOutputFiles(fb);
00098   }
00099 
00100   void
00101   EDProducer::doRespondToCloseOutputFiles(FileBlock const& fb) {
00102     respondToCloseOutputFiles(fb);
00103   }
00104 
00105   void 
00106   EDProducer::doPreForkReleaseResources() {
00107     preForkReleaseResources();
00108   }
00109   
00110   void 
00111   EDProducer::doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren) {
00112     postForkReacquireResources(iChildIndex, iNumberOfChildren);
00113   }
00114   
00115   CurrentProcessingContext const*
00116   EDProducer::currentContext() const {
00117     return current_context_;
00118   }
00119 
00120   void
00121   EDProducer::fillDescriptions(ConfigurationDescriptions& descriptions) {
00122     ParameterSetDescription desc;
00123     desc.setUnknown();
00124     descriptions.addDefault(desc);
00125   }
00126   
00127   static const std::string kBaseType("EDProducer");
00128   
00129   const std::string&
00130   EDProducer::baseType() {
00131     return kBaseType;
00132   }
00133 }