Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimDataMixingHcalWorker_h
0002 #define SimDataMixingHcalWorker_h
0003 
0004 /** \class DataMixingHcalWorker
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
0010  *
0011  * \author Mike Hildreth, University of Notre Dame
0012  *
0013  * \version   1st Version October 2007
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/ParameterSet/interface/ParameterSet.h"
0021 
0022 #include "DataFormats/Common/interface/Handle.h"
0023 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0024 #include "DataFormats/Provenance/interface/ProductID.h"
0025 
0026 #include <map>
0027 #include <string>
0028 #include <vector>
0029 
0030 namespace edm {
0031   class ModuleCallingContext;
0032 
0033   class DataMixingHcalWorker {
0034   public:
0035     DataMixingHcalWorker();
0036 
0037     /** standard constructor*/
0038     explicit DataMixingHcalWorker(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC);
0039 
0040     /**Default destructor*/
0041     virtual ~DataMixingHcalWorker();
0042 
0043     void putHcal(edm::Event &e);
0044     void addHcalSignals(const edm::Event &e);
0045     void addHcalPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *);
0046 
0047   private:
0048     // data specifiers
0049 
0050     // Hcal
0051     edm::InputTag HBHErechitCollectionSig_;  // secondary name given to collection
0052                                              // of EB rechits
0053     edm::InputTag HOrechitCollectionSig_;    // secondary name given to collection of
0054                                              // EB rechits
0055     edm::InputTag HFrechitCollectionSig_;    // secondary name given to collection of
0056                                              // EB rechits
0057     edm::InputTag ZDCrechitCollectionSig_;   // secondary name given to collection
0058                                              // of EB rechits
0059 
0060     edm::InputTag HBHEPileRecHitInputTag_;  // InputTag for HB RecHits for Pileup
0061     edm::InputTag HOPileRecHitInputTag_;    // InputTag for HO RecHits for Pileup
0062     edm::InputTag HFPileRecHitInputTag_;    // InputTag for HF RecHits for Pileup
0063     edm::InputTag ZDCPileRecHitInputTag_;   // InputTag for ZDC RecHits for Pileup
0064 
0065     edm::EDGetTokenT<HBHERecHitCollection> HBHERecHitToken_;  // Token to retrieve information
0066     edm::EDGetTokenT<HORecHitCollection> HORecHitToken_;      // Token to retrieve information
0067     edm::EDGetTokenT<HFRecHitCollection> HFRecHitToken_;      // Token to retrieve information
0068     edm::EDGetTokenT<ZDCRecHitCollection> ZDCRecHitToken_;    // Token to retrieve information
0069 
0070     edm::EDGetTokenT<HBHERecHitCollection> HBHERecHitPToken_;  // Token to retrieve information
0071     edm::EDGetTokenT<HORecHitCollection> HORecHitPToken_;      // Token to retrieve information
0072     edm::EDGetTokenT<HFRecHitCollection> HFRecHitPToken_;      // Token to retrieve information
0073     edm::EDGetTokenT<ZDCRecHitCollection> ZDCRecHitPToken_;    // Token to retrieve information
0074 
0075     std::string HBHERecHitCollectionDM_;  // secondary name to be given to EB
0076                                           // collection of hits
0077     std::string HORecHitCollectionDM_;    // secondary name to be given to EB
0078                                           // collection of hits
0079     std::string HFRecHitCollectionDM_;    // secondary name to be given to EB
0080                                           // collection of hits
0081     std::string ZDCRecHitCollectionDM_;   // secondary name to be given to EB
0082                                           // collection of hits
0083 
0084     typedef std::multimap<DetId, HBHERecHit> HBHERecHitMap;
0085     typedef std::multimap<DetId, HFRecHit> HFRecHitMap;
0086     typedef std::multimap<DetId, HORecHit> HORecHitMap;
0087     typedef std::multimap<DetId, ZDCRecHit> ZDCRecHitMap;
0088 
0089     HBHERecHitMap HBHERecHitStorage_;
0090     HFRecHitMap HFRecHitStorage_;
0091     HORecHitMap HORecHitStorage_;
0092     ZDCRecHitMap ZDCRecHitStorage_;
0093 
0094     //      unsigned int eventId_; //=0 for signal, from 1-n for pileup events
0095 
0096     std::string label_;
0097   };
0098 }  // namespace edm
0099 
0100 #endif  // SimDataMixingHcalWorker_h