Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:08

0001 #ifndef SimGeneral_PreMixingModule_PreMixingPileupCopy_h
0002 #define SimGeneral_PreMixingModule_PreMixingPileupCopy_h
0003 
0004 /** \class PreMixingPileupCopy
0005  *
0006  * This class takes care of existing pileup information in the case of pre-mixing
0007  *
0008  * Originally from DataMixingModule, tailored further for premixing.
0009  *
0010  ************************************************************/
0011 
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "FWCore/Framework/interface/ConsumesCollector.h"
0015 #include "FWCore/Framework/interface/ProducesCollector.h"
0016 
0017 #include "DataFormats/Provenance/interface/ProductID.h"
0018 #include "DataFormats/Common/interface/Handle.h"
0019 
0020 #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
0021 #include "SimDataFormats/CrossingFrame/interface/CrossingFramePlaybackInfoNew.h"
0022 
0023 #include <vector>
0024 #include <string>
0025 
0026 namespace reco {
0027   class GenParticle;
0028 }
0029 class PileUpEventPrincipal;
0030 
0031 namespace edm {
0032   class ModuleCallingContext;
0033 
0034   class PreMixingPileupCopy {
0035   public:
0036     PreMixingPileupCopy(const edm::ParameterSet& ps, edm::ProducesCollector, edm::ConsumesCollector&& iC);
0037     ~PreMixingPileupCopy() = default;
0038 
0039     float getTrueNumInteractions(PileUpEventPrincipal const& pep) const;
0040 
0041     void addPileupInfo(PileUpEventPrincipal const& pep);
0042     const std::vector<PileupSummaryInfo>& getPileupSummaryInfo() const { return pileupSummaryStorage_; }
0043     int getBunchSpacing() const { return bsStorage_; }
0044     void putPileupInfo(edm::Event& e);
0045 
0046   private:
0047     edm::InputTag pileupInfoInputTag_;    // InputTag for PileupSummaryInfo
0048     edm::InputTag bunchSpacingInputTag_;  // InputTag for bunch spacing int
0049     edm::InputTag cfPlaybackInputTag_;    // InputTag for CrossingFrame Playback information
0050 
0051     std::vector<edm::InputTag> genPUProtonsInputTags_;
0052 
0053     // deliver data from addPileupInfo() to getPileupInfo() and putPileupInfo()
0054     CrossingFramePlaybackInfoNew crossingFramePlaybackStorage_;
0055     std::vector<PileupSummaryInfo> pileupSummaryStorage_;
0056     int bsStorage_;
0057 
0058     std::vector<std::string> genPUProtons_labels_;
0059     std::vector<std::vector<reco::GenParticle> > genPUProtons_;
0060 
0061     bool foundPlayback_;
0062   };
0063 }  // namespace edm
0064 
0065 #endif