Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008 #include "FWCore/Utilities/interface/EDMException.h"
00009 #include "DataMixingHcalDigiWorkerProd.h"
00010
00011
00012 using namespace std;
00013 namespace edm {
00014
00015 DataMixingHcalDigiWorkerProd::DataMixingHcalDigiWorkerProd(const edm::ParameterSet& ps) :
00016 HBHEPileInputTag_(ps.getParameter<edm::InputTag>("HBHEPileInputTag")),
00017 HOPileInputTag_(ps.getParameter<edm::InputTag>("HOPileInputTag")),
00018 HFPileInputTag_(ps.getParameter<edm::InputTag>("HFPileInputTag")),
00019 ZDCPileInputTag_(ps.getParameter<edm::InputTag>("ZDCPileInputTag")),
00020 theHBHESignalGenerator(HBHEPileInputTag_),
00021 theHOSignalGenerator(HOPileInputTag_),
00022 theHFSignalGenerator(HFPileInputTag_),
00023 theZDCSignalGenerator(ZDCPileInputTag_),
00024 label_(ps.getParameter<std::string>("Label"))
00025 {
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 HBHEDigiCollectionDM_ = ps.getParameter<std::string>("HBHEDigiCollectionDM");
00036 HODigiCollectionDM_ = ps.getParameter<std::string>("HODigiCollectionDM");
00037 HFDigiCollectionDM_ = ps.getParameter<std::string>("HFDigiCollectionDM");
00038 ZDCDigiCollectionDM_ = ps.getParameter<std::string>("ZDCDigiCollectionDM");
00039
00040
00041
00042 myHcalDigitizer_ = new HcalDigitizer( ps );
00043
00044 myHcalDigitizer_->setHBHENoiseSignalGenerator( & theHBHESignalGenerator );
00045 myHcalDigitizer_->setHFNoiseSignalGenerator( & theHFSignalGenerator );
00046 myHcalDigitizer_->setHONoiseSignalGenerator( & theHOSignalGenerator );
00047 myHcalDigitizer_->setZDCNoiseSignalGenerator( & theZDCSignalGenerator );
00048
00049 }
00050
00051
00052 DataMixingHcalDigiWorkerProd::~DataMixingHcalDigiWorkerProd() {
00053 delete myHcalDigitizer_;
00054 }
00055
00056 void DataMixingHcalDigiWorkerProd::addHcalSignals(const edm::Event &e,const edm::EventSetup& ES) {
00057
00058
00059
00060 }
00061
00062 void DataMixingHcalDigiWorkerProd::addHcalPileups(const int bcr, const EventPrincipal *ep, unsigned int eventNr,const edm::EventSetup& ES) {
00063
00064 LogDebug("DataMixingHcalDigiWorkerProd") <<"\n===============> adding pileups from event "<<ep->id()<<" for bunchcrossing "<<bcr;
00065
00066 theHBHESignalGenerator.initializeEvent(ep, &ES);
00067 theHOSignalGenerator.initializeEvent(ep, &ES);
00068 theHFSignalGenerator.initializeEvent(ep, &ES);
00069 theZDCSignalGenerator.initializeEvent(ep, &ES);
00070
00071 theHBHESignalGenerator.fill();
00072 theHOSignalGenerator.fill();
00073 theHFSignalGenerator.fill();
00074 }
00075
00076 void DataMixingHcalDigiWorkerProd::putHcal(edm::Event &e,const edm::EventSetup& ES) {
00077
00078
00079
00080 myHcalDigitizer_->initializeEvent( e, ES );
00081 myHcalDigitizer_->finalizeEvent( e, ES );
00082 }
00083
00084 }
00085