Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:33

0001 #ifndef SimDataMixingPileupCopy_h
0002 #define SimDataMixingPileupCopy_h
0003 
0004 /** \class DataMixingPileupCopy
0005  *
0006  * DataMixingModule is the EDProducer subclass
0007  * that overlays rawdata events on top of MC,
0008  * using real data for pileup simulation
0009  * This class takes care of existing pileup information in the case of
0010  *pre-mixing
0011  *
0012  * \author Mike Hildreth, University of Notre Dame
0013  *
0014  * \version   1st Version October 2007
0015  *
0016  ************************************************************/
0017 
0018 #include "FWCore/Framework/interface/ConsumesCollector.h"
0019 #include "FWCore/Framework/interface/Event.h"
0020 #include "FWCore/Framework/interface/EventPrincipal.h"
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022 
0023 #include "DataFormats/Common/interface/Handle.h"
0024 #include "DataFormats/Provenance/interface/ProductID.h"
0025 
0026 #include "SimDataFormats/CrossingFrame/interface/CrossingFramePlaybackInfoNew.h"
0027 #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h"
0028 
0029 #include <map>
0030 #include <string>
0031 #include <vector>
0032 
0033 namespace reco {
0034   class GenParticle;
0035 }
0036 
0037 namespace edm {
0038   class ModuleCallingContext;
0039 
0040   class DataMixingPileupCopy {
0041   public:
0042     DataMixingPileupCopy();
0043 
0044     /** standard constructor*/
0045     explicit DataMixingPileupCopy(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC);
0046 
0047     /**Default destructor*/
0048     virtual ~DataMixingPileupCopy();
0049 
0050     void putPileupInfo(edm::Event &e);
0051     void addPileupInfo(const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *mcc);
0052 
0053     void getPileupInfo(std::vector<PileupSummaryInfo> &ps, int &bs) {
0054       ps = PileupSummaryStorage_;
0055       bs = bsStorage_;
0056     }
0057 
0058   private:
0059     // data specifiers
0060 
0061     edm::InputTag PileupInfoInputTag_;    // InputTag for PileupSummaryInfo
0062     edm::InputTag BunchSpacingInputTag_;  // InputTag for bunch spacing int
0063     edm::InputTag CFPlaybackInputTag_;    // InputTag for CrossingFrame Playback information
0064 
0065     std::vector<edm::InputTag> GenPUProtonsInputTags_;
0066 
0067     CrossingFramePlaybackInfoNew CrossingFramePlaybackStorage_;
0068 
0069     std::vector<PileupSummaryInfo> PileupSummaryStorage_;
0070     int bsStorage_;
0071 
0072     std::vector<std::string> GenPUProtons_labels_;
0073     std::vector<std::vector<reco::GenParticle>> GenPUProtons_;
0074 
0075     //      unsigned int eventId_; //=0 for signal, from 1-n for pileup events
0076 
0077     std::string label_;
0078 
0079     bool FoundPlayback_;
0080   };
0081 }  // namespace edm
0082 
0083 #endif  // SimDataMixingPileupCopy_h