Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-07 04:54:24

0001 #ifndef SimDataMixingHcalDigiWorkerProd_h
0002 #define SimDataMixingHcalDigiWorkerProd_h
0003 
0004 /** \class DataMixingHcalDigiWorkerProd
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 the Hcal information at Digi level
0010  *
0011  * \author Mike Hildreth, University of Notre Dame
0012  *
0013  * \version   1st Version June 2008
0014  *
0015  ************************************************************/
0016 
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/EventPrincipal.h"
0019 #include "FWCore/Framework/interface/EventSetup.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 
0022 #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
0023 #include "DataFormats/Common/interface/Handle.h"
0024 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
0025 #include "DataFormats/HcalDigi/interface/HFDataFrame.h"
0026 #include "DataFormats/HcalDigi/interface/HODataFrame.h"
0027 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0028 #include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"
0029 #include "DataFormats/HcalDigi/interface/QIE11DataFrame.h"
0030 #include "DataFormats/Provenance/interface/ProductID.h"
0031 #include "SimCalorimetry/HcalSimAlgos/interface/HcalSignalGenerator.h"
0032 #include "SimCalorimetry/HcalSimProducers/interface/HcalDigiProducer.h"
0033 #include "SimGeneral/DataMixingModule/plugins/HcalNoiseStorage.h"
0034 
0035 #include <map>
0036 #include <string>
0037 #include <vector>
0038 
0039 namespace edm {
0040   class ConsumesCollector;
0041   class ModuleCallingContext;
0042 
0043   class DataMixingHcalDigiWorkerProd {
0044   public:
0045     /** standard constructor*/
0046     explicit DataMixingHcalDigiWorkerProd(const edm::ParameterSet &ps,
0047                                           edm::ConsumesCollector &&iC,
0048                                           const edm::ESGetToken<HcalDbService, HcalDbRecord> &);
0049 
0050     /**Default destructor*/
0051     virtual ~DataMixingHcalDigiWorkerProd();
0052 
0053     void putHcal(edm::Event &e, const edm::EventSetup &ES);
0054     void addHcalSignals(const edm::Event &e, const edm::EventSetup &ES);
0055     void addHcalPileups(const int bcr,
0056                         const edm::EventPrincipal *,
0057                         unsigned int EventId,
0058                         const edm::EventSetup &ES,
0059                         edm::ModuleCallingContext const *);
0060 
0061     void beginRun(const edm::Run &run, const edm::EventSetup &ES);
0062     void initializeEvent(const edm::Event &e, const edm::EventSetup &ES);
0063 
0064   private:
0065     // data specifiers
0066 
0067     // Hcal
0068     edm::InputTag HBHEPileInputTag_;     // InputTag for Pileup Digis collection
0069     edm::InputTag HOPileInputTag_;       // InputTag for Pileup Digis collection
0070     edm::InputTag HFPileInputTag_;       // InputTag for Pileup Digis collection
0071     edm::InputTag ZDCPileInputTag_;      // InputTag for Pileup Digis collection
0072     edm::InputTag QIE10PileInputTag_;    // InputTag for Pileup Digis collection
0073     edm::InputTag QIE11PileInputTag_;    // InputTag for Pileup Digis collection
0074     std::string HBHEDigiCollectionDM_;   // secondary name to be given to collection
0075                                          // of digis
0076     std::string HODigiCollectionDM_;     // secondary name to be given to collection of digis
0077     std::string HFDigiCollectionDM_;     // secondary name to be given to collection of digis
0078     std::string ZDCDigiCollectionDM_;    // secondary name to be given to collection of digis
0079     std::string QIE10DigiCollectionDM_;  // secondary name to be given to
0080                                          // collection of digis
0081     std::string QIE11DigiCollectionDM_;  // secondary name to be given to
0082                                          // collection of digis
0083 
0084     edm::EDGetTokenT<HBHEDigitizerTraits::DigiCollection> tok_hbhe_;
0085     edm::EDGetTokenT<HODigitizerTraits::DigiCollection> tok_ho_;
0086     edm::EDGetTokenT<HFDigitizerTraits::DigiCollection> tok_hf_;
0087     edm::EDGetTokenT<ZDCDigitizerTraits::DigiCollection> tok_zdc_;
0088     edm::EDGetTokenT<HcalQIE10DigitizerTraits::DigiCollection> tok_qie10_;
0089     edm::EDGetTokenT<HcalQIE11DigitizerTraits::DigiCollection> tok_qie11_;
0090 
0091     const edm::ESGetToken<HcalDbService, HcalDbRecord> tokDB_;
0092 
0093     HcalDigiProducer *myHcalDigitizer_;
0094     HBHESignalGenerator theHBHESignalGenerator;
0095     HOSignalGenerator theHOSignalGenerator;
0096     HFSignalGenerator theHFSignalGenerator;
0097     ZDCSignalGenerator theZDCSignalGenerator;
0098     QIE10SignalGenerator theQIE10SignalGenerator;
0099     QIE11SignalGenerator theQIE11SignalGenerator;
0100 
0101     std::string label_;
0102   };
0103 }  // namespace edm
0104 
0105 #endif  // SimDataMixingHcalDigiWorkerProd_h