CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/SimGeneral/DataMixingModule/plugins/DataMixingEMDigiWorker.h

Go to the documentation of this file.
00001 #ifndef DataMixingEMDigiWorker_h
00002 #define SimDataMixingEMDigiWorker_h
00003 
00017 #include "FWCore/Framework/interface/Event.h"
00018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00019 #include "FWCore/Framework/interface/Selector.h"
00020 #include "FWCore/Framework/interface/EventPrincipal.h"
00021 
00022 #include "DataFormats/Provenance/interface/ProductID.h"
00023 #include "DataFormats/Common/interface/Handle.h"
00024 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00025 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00026 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00027 
00028 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00029 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
00030 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
00031 #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
00032 
00033 
00034 #include <map>
00035 #include <vector>
00036 #include <string>
00037 
00038 
00039 namespace edm
00040 {
00041   class DataMixingEMDigiWorker
00042     {
00043     public:
00044 
00045       DataMixingEMDigiWorker();
00046 
00048       explicit DataMixingEMDigiWorker(const edm::ParameterSet& ps);
00049 
00051       virtual ~DataMixingEMDigiWorker();
00052 
00053       void putEM(edm::Event &e,const edm::EventSetup& ES) ;
00054       void addEMSignals(const edm::Event &e,const edm::EventSetup& ES); 
00055       void addEMPileups(const int bcr, const edm::EventPrincipal*,unsigned int EventId,const edm::EventSetup& ES);
00056 
00057 
00058     private:
00060       const std::vector<float> GetPedestals (const edm::EventSetup& ES, 
00061                                              const DetId& detid) ;
00062 
00064       const std::vector<float> GetGainRatios(const edm::EventSetup& ES, 
00065                                              const DetId& detid) ;
00066 
00067       // data specifiers
00068 
00069       edm::InputTag EBProducerSig_; // primary? name given to collection of EB calib digis
00070       edm::InputTag EEProducerSig_; // primary? name given to collection of EE calib digis
00071       edm::InputTag ESProducerSig_; // primary? name given to collection of ES calib digis
00072 
00073       edm::InputTag EBdigiCollectionSig_; // secondary name given to collection of EB calib digis
00074       edm::InputTag EEdigiCollectionSig_; // secondary name given to collection of EE calib digis
00075       edm::InputTag ESdigiCollectionSig_; // secondary name given to collection of ES calib digis
00076 
00077       edm::InputTag EBPileInputTag_; // complete input tag for EB pileup digis
00078       edm::InputTag EEPileInputTag_; // complete input tag for EE pileup digis
00079       edm::InputTag ESPileInputTag_; // complete input tag for ES pileup digis
00080 
00081       std::string EBDigiCollectionDM_; // secondary name to be given to EB collection of hits
00082       std::string EEDigiCollectionDM_; // secondary name to be given to EE collection of hits
00083       std::string ESDigiCollectionDM_; // secondary name to be given to ES collection of hits
00084 
00085       typedef std::multimap<DetId, EBDataFrame> EBDigiMap;
00086       typedef std::multimap<DetId, EEDataFrame> EEDigiMap;
00087       typedef std::multimap<DetId, ESDataFrame> ESDigiMap;
00088 
00089       EBDigiMap EBDigiStorage_;
00090       EEDigiMap EEDigiStorage_;
00091       ESDigiMap ESDigiStorage_;
00092 
00093 
00094       //      unsigned int eventId_; //=0 for signal, from 1-n for pileup events
00095 
00096       Selector * sel_;
00097       std::string label_;
00098 
00099     };
00100 }//edm
00101 
00102 #endif