CMS 3D CMS Logo

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