Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SimDataMixingEMWorker_h
0002 #define SimDataMixingEMWorker_h
0003 
0004 /** \class DataMixingEMWorker
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 EM 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/EcalDetId/interface/EBDetId.h"
0024 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0025 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0026 #include "DataFormats/EcalRecHit/interface/EcalRecHit.h"
0027 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0028 #include "DataFormats/Provenance/interface/ProductID.h"
0029 
0030 #include <map>
0031 #include <string>
0032 #include <vector>
0033 
0034 namespace edm {
0035   class ModuleCallingContext;
0036 
0037   class DataMixingEMWorker {
0038   public:
0039     DataMixingEMWorker();
0040 
0041     /** standard constructor*/
0042     explicit DataMixingEMWorker(const edm::ParameterSet &ps, edm::ConsumesCollector &&iC);
0043 
0044     /**Default destructor*/
0045     virtual ~DataMixingEMWorker();
0046 
0047     void putEM(edm::Event &e);
0048     void addEMSignals(const edm::Event &e);
0049     void addEMPileups(const int bcr, const edm::EventPrincipal *, unsigned int EventId, ModuleCallingContext const *);
0050 
0051   private:
0052     // data specifiers
0053 
0054     edm::InputTag EBProducerSig_;  // primary? name given to collection of EB calib rechits
0055     edm::InputTag EEProducerSig_;  // primary? name given to collection of EE calib rechits
0056     edm::InputTag ESProducerSig_;  // primary? name given to collection of ES calib rechits
0057 
0058     edm::InputTag EBrechitCollectionSig_;  // secondary name given to collection of
0059                                            // EB calib rechits
0060     edm::InputTag EErechitCollectionSig_;  // secondary name given to collection of
0061                                            // EE calib rechits
0062     edm::InputTag ESrechitCollectionSig_;  // secondary name given to collection of
0063                                            // ES calib rechits
0064 
0065     edm::InputTag EBPileRecHitInputTag_;  // full InputTag for pileup EB calib rechits
0066     edm::InputTag EEPileRecHitInputTag_;  // full InputTag for pileup EE calib rechits
0067     edm::InputTag ESPileRecHitInputTag_;  // full InputTag for pileup ES calib rechits
0068 
0069     edm::EDGetTokenT<EBRecHitCollection> EBRecHitToken_;  // Token to retrieve information
0070     edm::EDGetTokenT<EERecHitCollection> EERecHitToken_;  // Token to retrieve information
0071     edm::EDGetTokenT<ESRecHitCollection> ESRecHitToken_;  // Token to retrieve information
0072 
0073     edm::EDGetTokenT<EBRecHitCollection> EBPileRecHitToken_;  // Token to retrieve information
0074     edm::EDGetTokenT<EERecHitCollection> EEPileRecHitToken_;  // Token to retrieve information
0075     edm::EDGetTokenT<ESRecHitCollection> ESPileRecHitToken_;  // Token to retrieve information
0076 
0077     std::string EBRecHitCollectionDM_;  // secondary name to be given to EB
0078                                         // collection of hits
0079     std::string EERecHitCollectionDM_;  // secondary name to be given to EE
0080                                         // collection of hits
0081     std::string ESRecHitCollectionDM_;  // secondary name to be given to ES
0082                                         // collection of hits
0083 
0084     typedef std::multimap<DetId, EcalRecHit> EBRecHitMap;
0085     typedef std::multimap<DetId, EcalRecHit> EERecHitMap;
0086     typedef std::multimap<DetId, EcalRecHit> ESRecHitMap;
0087 
0088     EBRecHitMap EBRecHitStorage_;
0089     EERecHitMap EERecHitStorage_;
0090     ESRecHitMap ESRecHitStorage_;
0091 
0092     //      unsigned int eventId_; //=0 for signal, from 1-n for pileup events
0093 
0094     std::string label_;
0095   };
0096 }  // namespace edm
0097 
0098 #endif  // SimDataMixingEMWorker_h