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 "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00029 #include "SimDataFormats/PileupSummaryInfo/interface/PileupMixingContent.h"
00030
00031 #include "DataFormats/Provenance/interface/ProductID.h"
00032 #include "DataFormats/Common/interface/Handle.h"
00033 #include <vector>
00034 #include <string>
00035
00036 class CrossingFramePlaybackInfoExtended;
00037 class DigiAccumulatorMixMod;
00038 class PileUpEventPrincipal;
00039
00040 namespace edm {
00041 class MixingWorkerBase;
00042
00043 class MixingModule : public BMixingModule {
00044 public:
00045 typedef std::vector<DigiAccumulatorMixMod*> Accumulators;
00046
00048 explicit MixingModule(const edm::ParameterSet& ps);
00049
00051 virtual ~MixingModule();
00052
00053 virtual void beginJob() {}
00054
00055 virtual void beginRun(Run& r1, EventSetup const& c);
00056
00057 virtual void endRun(Run& r1, EventSetup const& c);
00058
00059 virtual void beginLuminosityBlock(LuminosityBlock& l1, EventSetup const& c);
00060
00061 virtual void endLuminosityBlock(LuminosityBlock& l1, EventSetup const& c);
00062
00063 void initializeEvent(Event const& event, EventSetup const& setup);
00064
00065 void accumulateEvent(Event const& event, EventSetup const& setup);
00066
00067 void accumulateEvent(PileUpEventPrincipal const& event, EventSetup const& setup);
00068
00069 void finalizeEvent(Event& event, EventSetup const& setup);
00070
00071 virtual void reload(const edm::EventSetup &);
00072
00073 private:
00074 virtual void branchesActivate(const std::string &friendlyName, const std::string &subdet, InputTag &tag, std::string &label);
00075 virtual void put(edm::Event &e,const edm::EventSetup& es);
00076 virtual void createnewEDProduct();
00077 virtual void checkSignal(const edm::Event &e);
00078 virtual void addSignals(const edm::Event &e, const edm::EventSetup& es);
00079 virtual void doPileUp(edm::Event &e, const edm::EventSetup& es);
00080 void pileAllWorkers(EventPrincipal const& ep, int bcr, int id, int& offset,
00081 const edm::EventSetup& setup);
00082 void createDigiAccumulators( const edm::ParameterSet& mixingPSet ) ;
00083
00084 InputTag inputTagPlayback_;
00085 bool mixProdStep2_;
00086 bool mixProdStep1_;
00087 CrossingFramePlaybackInfoExtended *playbackInfo_;
00088
00089 std::vector<MixingWorkerBase *> workers_;
00090 std::vector<MixingWorkerBase *> workersObjects_;
00091 std::vector<std::string> wantedBranches_;
00092 bool useCurrentProcessOnly_;
00093
00094
00095 Accumulators digiAccumulators_ ;
00096
00097 };
00098 }
00099
00100 #endif