Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:03:02

0001 #ifndef SimGeneral_MixingModule_DigiAccumulatorMixMod_h
0002 #define SimGeneral_MixingModule_DigiAccumulatorMixMod_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     MixingModule
0006 // Class  :     DigiAccumulatorMixMod
0007 //
0008 /**\class DigiAccumulatorMixMod DigiAccumulatorMixMod.h SimGeneral/MixingModule/interface/DigiAccumulatorMixMod.h
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Werner Sun
0018 //         Created:  Tue Sep 20 17:33:33 CEST 2011
0019 //
0020 
0021 // system include files
0022 #include <vector>
0023 #include "SimDataFormats/PileupSummaryInfo/interface/PileupMixingContent.h"
0024 #include "DataFormats/Provenance/interface/EventID.h"
0025 
0026 // user include files
0027 
0028 // forward declarations
0029 
0030 namespace edm {
0031   class Event;
0032   class EventPrincipal;
0033   class EventSetup;
0034   class LuminosityBlock;
0035   class Run;
0036   class StreamID;
0037 }  // namespace edm
0038 
0039 class PileUpEventPrincipal;
0040 
0041 class DigiAccumulatorMixMod {
0042 public:
0043   DigiAccumulatorMixMod();
0044 
0045   DigiAccumulatorMixMod(DigiAccumulatorMixMod const&) = delete;  // stop default
0046 
0047   DigiAccumulatorMixMod const& operator=(DigiAccumulatorMixMod const&) = delete;  // stop default
0048 
0049   virtual ~DigiAccumulatorMixMod();
0050 
0051   // ---------- const member functions ---------------------
0052 
0053   // ---------- static member functions --------------------
0054 
0055   // ---------- member functions ---------------------------
0056   // Perform algorithm setup for each event before any signal/pileup events are processed.
0057   virtual void initializeEvent(edm::Event const& event, edm::EventSetup const& setup) = 0;
0058 
0059   // Accumulate digis or other data for each signal event.
0060   virtual void accumulate(edm::Event const& event, edm::EventSetup const& setup) = 0;
0061 
0062   // Accumulate digis or other data for each pileup event, one at a time.
0063   virtual void accumulate(PileUpEventPrincipal const& event, edm::EventSetup const& setup, edm::StreamID const&) = 0;
0064 
0065   // 1. Finalize digi collections or other data for each event.
0066   // 2. Put products in Event with appropriate instance labels
0067   virtual void finalizeEvent(edm::Event& event, edm::EventSetup const& setup) = 0;  // event is non-const
0068 
0069   // Perform any necessary actions before pileup events for a given bunch crossing are processed.
0070   virtual void initializeBunchCrossing(edm::Event const& event, edm::EventSetup const& setup, int bunchCrossing) {}
0071 
0072   // Perform any necessary actions after pileup events for a given bunch crossing are processed.
0073   // This may include putting bunch crossing specific products into the event.
0074   virtual void finalizeBunchCrossing(edm::Event& event, edm::EventSetup const& setup, int bunchCrossing) {}
0075 
0076   virtual void beginRun(edm::Run const& run, edm::EventSetup const& setup) {}
0077   virtual void endRun(edm::Run const& run, edm::EventSetup const& setup) {}
0078   virtual void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& setup) {}
0079   virtual void endLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& setup) {}
0080 
0081   virtual void StorePileupInformation(std::vector<int>& numInteractionList,
0082                                       std::vector<int>& bunchCrossingList,
0083                                       std::vector<float>& TrueInteractionList,
0084                                       std::vector<edm::EventID>& eventList,
0085                                       int bunchSpace) {}
0086 
0087   virtual PileupMixingContent* getEventPileupInfo() {
0088     std::cout << " You must override the virtual functions in DigiAccumulatorMixMod in\n"
0089               << "order to access PileupInformation.  Returning empty object." << std::endl;
0090 
0091     PileupMixingContent* dummyPileupObject = new PileupMixingContent();
0092 
0093     return dummyPileupObject;
0094   }
0095 
0096 private:
0097   // ---------- member data --------------------------------
0098 };
0099 
0100 #endif