CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/SimGeneral/MixingModule/plugins/MixingModule.h

Go to the documentation of this file.
00001 #ifndef MixingModule_h
00002 #define MixingModule_h
00003 
00017 #include "Mixing/Base/interface/BMixingModule.h"
00018 
00019 #include "FWCore/Framework/interface/Event.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 #include "FWCore/Utilities/interface/InputTag.h"
00022 
00023 #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
00024 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00025 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00026 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00027 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00028 #include "DataFormats/TrackReco/interface/Track.h"
00029 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00030 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00031 #include "SimDataFormats/PileupSummaryInfo/interface/PileupMixingContent.h"
00032 
00033 #include "DataFormats/Provenance/interface/ProductID.h"
00034 #include "DataFormats/Common/interface/Handle.h"
00035 #include <vector>
00036 #include <string>
00037 
00038 class CrossingFramePlaybackInfoExtended;
00039 class DigiAccumulatorMixMod;
00040 class PileUpEventPrincipal;
00041 
00042 namespace edm {
00043   class AdjusterBase;
00044   class MixingWorkerBase;
00045 
00046   class MixingModule : public BMixingModule {
00047     public:
00048       typedef std::vector<DigiAccumulatorMixMod*> Accumulators;
00049 
00051       explicit MixingModule(const edm::ParameterSet& ps);
00052 
00054       virtual ~MixingModule();
00055 
00056       virtual void beginJob() {}
00057 
00058       virtual void beginRun(Run const& r1, EventSetup const& c) override;
00059 
00060       virtual void endRun(Run const& r1, EventSetup const& c) override;
00061 
00062       virtual void beginLuminosityBlock(LuminosityBlock const& l1, EventSetup const& c) override;
00063 
00064       virtual void endLuminosityBlock(LuminosityBlock const& l1, EventSetup const& c) override;
00065 
00066       void initializeEvent(Event const& event, EventSetup const& setup);
00067 
00068       void accumulateEvent(Event const& event, EventSetup const& setup);
00069 
00070       void accumulateEvent(PileUpEventPrincipal const& event, EventSetup const& setup);
00071 
00072       void finalizeEvent(Event& event, EventSetup const& setup);
00073 
00074       virtual void reload(const edm::EventSetup &);
00075  
00076     private:
00077       virtual void branchesActivate(const std::string &friendlyName, const std::string &subdet, InputTag &tag, std::string &label);
00078       virtual void put(edm::Event &e,const edm::EventSetup& es);
00079       virtual void createnewEDProduct();
00080       virtual void checkSignal(const edm::Event &e);
00081       virtual void addSignals(const edm::Event &e, const edm::EventSetup& es); 
00082       virtual void doPileUp(edm::Event &e, const edm::EventSetup& es);
00083       void pileAllWorkers(EventPrincipal const& ep, int bcr, int id, int& offset,
00084                           const edm::EventSetup& setup);
00085       void createDigiAccumulators( const edm::ParameterSet& mixingPSet ) ;
00086 
00087       InputTag inputTagPlayback_;
00088       bool mixProdStep2_;
00089       bool mixProdStep1_;
00090       CrossingFramePlaybackInfoExtended *playbackInfo_;
00091 
00092       std::vector<AdjusterBase *> adjusters_;
00093       std::vector<AdjusterBase *> adjustersObjects_;
00094       std::vector<MixingWorkerBase *> workers_;
00095       std::vector<MixingWorkerBase *> workersObjects_;
00096       std::vector<std::string> wantedBranches_;
00097       bool useCurrentProcessOnly_;
00098 
00099       // Digi-producing algorithms
00100       Accumulators digiAccumulators_ ;
00101 
00102   };
00103 }//edm
00104 
00105 #endif