Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimDataMixingHcalDigiWorker_h
0002 #define SimDataMixingHcalDigiWorker_h
0003 
0004 /** \class DataMixingHcalDigiWorker
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/ConsumesCollector.h"
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/Framework/interface/EventPrincipal.h"
0020 #include "FWCore/Framework/interface/EventSetup.h"
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022 
0023 #include "CalibFormats/CaloObjects/interface/CaloSamples.h"
0024 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
0025 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
0026 #include "DataFormats/Common/interface/Handle.h"
0027 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
0028 #include "DataFormats/HcalDigi/interface/HFDataFrame.h"
0029 #include "DataFormats/HcalDigi/interface/HODataFrame.h"
0030 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
0031 #include "DataFormats/HcalDigi/interface/QIE10DataFrame.h"
0032 #include "DataFormats/HcalDigi/interface/QIE11DataFrame.h"
0033 #include "DataFormats/Provenance/interface/ProductID.h"
0034 
0035 #include <map>
0036 #include <string>
0037 #include <vector>
0038 
0039 namespace edm {
0040   class ModuleCallingContext;
0041 
0042   class DataMixingHcalDigiWorker {
0043   public:
0044     DataMixingHcalDigiWorker();
0045 
0046     /** standard constructor*/
0047     explicit DataMixingHcalDigiWorker(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC);
0048 
0049     /**Default destructor*/
0050     virtual ~DataMixingHcalDigiWorker();
0051 
0052     void putHcal(edm::Event &e, const edm::EventSetup &ES);
0053     void addHcalSignals(const edm::Event &e, const edm::EventSetup &ES);
0054     void addHcalPileups(const int bcr,
0055                         const edm::EventPrincipal *,
0056                         unsigned int EventId,
0057                         const edm::EventSetup &ES,
0058                         ModuleCallingContext const *);
0059 
0060   private:
0061     // data specifiers
0062 
0063     // Hcal
0064     edm::InputTag HBHEdigiCollectionSig_;   // secondary name given to collection of digis
0065     edm::InputTag HOdigiCollectionSig_;     // secondary name given to collection of digis
0066     edm::InputTag HFdigiCollectionSig_;     // secondary name given to collection of digis
0067     edm::InputTag ZDCdigiCollectionSig_;    // secondary name given to collection of digis
0068     edm::InputTag QIE10digiCollectionSig_;  // secondary name given to collection of digis
0069     edm::InputTag QIE11digiCollectionSig_;  // secondary name given to collection of digis
0070 
0071     edm::InputTag HBHEPileInputTag_;   // InputTag for Pileup Digis collection
0072     edm::InputTag HOPileInputTag_;     // InputTag for Pileup Digis collection
0073     edm::InputTag HFPileInputTag_;     // InputTag for Pileup Digis collection
0074     edm::InputTag ZDCPileInputTag_;    // InputTag for Pileup Digis collection
0075     edm::InputTag QIE10PileInputTag_;  // InputTag for Pileup Digis collection
0076     edm::InputTag QIE11PileInputTag_;  // InputTag for Pileup Digis collection
0077 
0078     edm::EDGetTokenT<HBHEDigiCollection> HBHEDigiToken_;    // Token to retrieve information
0079     edm::EDGetTokenT<HODigiCollection> HODigiToken_;        // Token to retrieve information
0080     edm::EDGetTokenT<HFDigiCollection> HFDigiToken_;        // Token to retrieve information
0081     edm::EDGetTokenT<ZDCDigiCollection> ZDCDigiToken_;      // Token to retrieve information
0082     edm::EDGetTokenT<QIE10DigiCollection> QIE10DigiToken_;  // Token to retrieve information
0083     edm::EDGetTokenT<QIE11DigiCollection> QIE11DigiToken_;  // Token to retrieve information
0084 
0085     edm::EDGetTokenT<HBHEDigiCollection> HBHEDigiPToken_;    // Token to retrieve information
0086     edm::EDGetTokenT<HODigiCollection> HODigiPToken_;        // Token to retrieve information
0087     edm::EDGetTokenT<HFDigiCollection> HFDigiPToken_;        // Token to retrieve information
0088     edm::EDGetTokenT<ZDCDigiCollection> ZDCDigiPToken_;      // Token to retrieve information
0089     edm::EDGetTokenT<QIE10DigiCollection> QIE10DigiPToken_;  // Token to retrieve information
0090     edm::EDGetTokenT<QIE11DigiCollection> QIE11DigiPToken_;  // Token to retrieve information
0091 
0092     std::string HBHEDigiCollectionDM_;   // secondary name to be given to collection
0093                                          // of digis
0094     std::string HODigiCollectionDM_;     // secondary name to be given to collection of digis
0095     std::string HFDigiCollectionDM_;     // secondary name to be given to collection of digis
0096     std::string ZDCDigiCollectionDM_;    // secondary name to be given to collection of digis
0097     std::string QIE10DigiCollectionDM_;  // secondary name to be given to
0098                                          // collection of digis
0099     std::string QIE11DigiCollectionDM_;  // secondary name to be given to
0100                                          // collection of digis
0101 
0102     typedef std::multimap<DetId, CaloSamples> HBHEDigiMap;
0103     typedef std::multimap<DetId, CaloSamples> HFDigiMap;
0104     typedef std::multimap<DetId, CaloSamples> HODigiMap;
0105     typedef std::multimap<DetId, CaloSamples> ZDCDigiMap;
0106     typedef std::multimap<DetId, CaloSamples> QIE10DigiMap;
0107     typedef std::multimap<DetId, CaloSamples> QIE11DigiMap;
0108 
0109     HBHEDigiMap HBHEDigiStorage_;
0110     HFDigiMap HFDigiStorage_;
0111     HODigiMap HODigiStorage_;
0112     ZDCDigiMap ZDCDigiStorage_;
0113     QIE10DigiMap QIE10DigiStorage_;
0114     QIE11DigiMap QIE11DigiStorage_;
0115 
0116     bool DoZDC_;
0117 
0118     std::string label_;
0119     edm::ESGetToken<HcalDbService, HcalDbRecord> dbToken_;
0120   };
0121 }  // namespace edm
0122 
0123 #endif  // SimDataMixingHcalDigiWorker_h