#include <FastSimulation/CaloRecHitsProducer/interface/CaloRecHitsProducer.h>
Public Member Functions | |
virtual void | beginRun (edm::Run &run, const edm::EventSetup &es) |
CaloRecHitsProducer (edm::ParameterSet const &p) | |
virtual void | endJob () |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
virtual | ~CaloRecHitsProducer () |
Private Attributes | |
bool | doDigis_ |
bool | doMiscalib_ |
std::string | EBrechitCollection_ |
EcalBarrelRecHitsMaker * | EcalBarrelRecHitsMaker_ |
EcalEndcapRecHitsMaker * | EcalEndcapRecHitsMaker_ |
EcalPreshowerRecHitsMaker * | EcalPreshowerRecHitsMaker_ |
std::string | EErechitCollection_ |
std::string | ESrechitCollection_ |
HcalRecHitsMaker * | HcalRecHitsMaker_ |
CaloGeometryHelper * | myCaloGeometryHelper_ |
const RandomEngine * | random |
Definition at line 23 of file CaloRecHitsProducer.h.
CaloRecHitsProducer::CaloRecHitsProducer | ( | edm::ParameterSet const & | p | ) | [explicit] |
Definition at line 22 of file CaloRecHitsProducer.cc.
References doDigis_, doMiscalib_, EBrechitCollection_, EcalBarrelRecHitsMaker_, EcalEndcapRecHitsMaker_, EcalPreshowerRecHitsMaker_, EErechitCollection_, ESrechitCollection_, Exception, edm::ParameterSet::getParameter(), HcalRecHitsMaker_, edm::Service< T >::isAvailable(), and random.
00023 : HcalRecHitsMaker_(NULL) 00024 { 00025 00026 // Initialize the random number generator service 00027 edm::Service<edm::RandomNumberGenerator> rng; 00028 if ( ! rng.isAvailable() ) { 00029 throw cms::Exception("Configuration") 00030 << "CaloRecHitsProducer requires the RandomGeneratorService\n" 00031 "which is not present in the configuration file.\n" 00032 "You must add the service in the configuration file\n" 00033 "or remove the module that requires it"; 00034 } 00035 00036 random = new RandomEngine(&(*rng)); 00037 00038 edm::ParameterSet RecHitsParameters = p.getParameter<edm::ParameterSet>("RecHitsFactory"); 00039 edm::ParameterSet CalibParameters = p.getParameter<edm::ParameterSet>("ContFact"); 00040 00041 EBrechitCollection_ = RecHitsParameters.getParameter<std::string>("EBrechitCollection"); 00042 EErechitCollection_ = RecHitsParameters.getParameter<std::string>("EErechitCollection"); 00043 ESrechitCollection_ = RecHitsParameters.getParameter<std::string>("ESrechitCollection"); 00044 00045 doDigis_ = RecHitsParameters.getParameter<bool>("doDigis"); 00046 doMiscalib_ = RecHitsParameters.getParameter<bool>("doMiscalib"); 00047 00048 produces<HBHERecHitCollection>(); 00049 produces<HORecHitCollection>(); 00050 produces<HFRecHitCollection>(); 00051 produces<EBRecHitCollection>(EBrechitCollection_); 00052 produces<EERecHitCollection>(EErechitCollection_); 00053 produces<ESRecHitCollection>(ESrechitCollection_); 00054 if(doDigis_) 00055 { 00056 produces<HBHEDigiCollection>(); 00057 produces<HODigiCollection>(); 00058 produces<HFDigiCollection>(); 00059 produces<EBDigiCollection>(); 00060 produces<EEDigiCollection>(); 00061 } 00062 00063 00064 HcalRecHitsMaker_ = 00065 new HcalRecHitsMaker(RecHitsParameters,p,random); 00066 EcalBarrelRecHitsMaker_ = 00067 new EcalBarrelRecHitsMaker(RecHitsParameters,CalibParameters,random); 00068 EcalEndcapRecHitsMaker_ = 00069 new EcalEndcapRecHitsMaker(RecHitsParameters,CalibParameters,random); 00070 EcalPreshowerRecHitsMaker_ = 00071 new EcalPreshowerRecHitsMaker(RecHitsParameters,random); 00072 }
CaloRecHitsProducer::~CaloRecHitsProducer | ( | ) | [virtual] |
void CaloRecHitsProducer::beginRun | ( | edm::Run & | run, | |
const edm::EventSetup & | es | |||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 82 of file CaloRecHitsProducer.cc.
References doDigis_, doMiscalib_, EcalBarrelRecHitsMaker_, EcalEndcapRecHitsMaker_, EcalPreshowerRecHitsMaker_, HcalRecHitsMaker_, EcalEndcapRecHitsMaker::init(), EcalPreshowerRecHitsMaker::init(), HcalRecHitsMaker::init(), and EcalBarrelRecHitsMaker::init().
00082 { 00083 // std::cout << " (Fast)RecHitsProducer initializing " << std::endl; 00084 EcalBarrelRecHitsMaker_->init(es,doDigis_,doMiscalib_); 00085 EcalEndcapRecHitsMaker_->init(es,doDigis_,doMiscalib_); 00086 EcalPreshowerRecHitsMaker_->init(es); 00087 HcalRecHitsMaker_->init(es,doDigis_,doMiscalib_); 00088 }
Reimplemented from edm::EDProducer.
Definition at line 90 of file CaloRecHitsProducer.cc.
References EcalBarrelRecHitsMaker_, EcalEndcapRecHitsMaker_, EcalPreshowerRecHitsMaker_, and HcalRecHitsMaker_.
00091 { 00092 //std::cout << " (Fast)RecHitsProducer terminating " << std::endl; 00093 if (EcalBarrelRecHitsMaker_) delete EcalBarrelRecHitsMaker_; 00094 if (EcalEndcapRecHitsMaker_) delete EcalEndcapRecHitsMaker_; 00095 if (EcalPreshowerRecHitsMaker_) delete EcalPreshowerRecHitsMaker_; 00096 if (HcalRecHitsMaker_) delete HcalRecHitsMaker_; 00097 }
void CaloRecHitsProducer::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 99 of file CaloRecHitsProducer.cc.
References doDigis_, EBrechitCollection_, EcalBarrelRecHitsMaker_, EcalEndcapRecHitsMaker_, EcalPreshowerRecHitsMaker_, EErechitCollection_, ESrechitCollection_, HcalRecHitsMaker_, EcalBarrelRecHitsMaker::loadEcalBarrelRecHits(), EcalEndcapRecHitsMaker::loadEcalEndcapRecHits(), EcalPreshowerRecHitsMaker::loadEcalPreshowerRecHits(), HcalRecHitsMaker::loadHcalRecHits(), and edm::Event::put().
00100 { 00101 00102 // create empty outputs for HCAL 00103 // see RecoLocalCalo/HcalRecProducers/src/HcalSimpleReconstructor.cc 00104 std::auto_ptr<EBRecHitCollection> receb(new EBRecHitCollection); // ECAL Barrel 00105 std::auto_ptr<EERecHitCollection> recee(new EERecHitCollection); // ECAL Endcap 00106 std::auto_ptr<ESRecHitCollection> reces(new ESRecHitCollection); // ECAL pre-shower 00107 00108 std::auto_ptr<HBHERecHitCollection> rec1(new HBHERecHitCollection); // Barrel+Endcap 00109 std::auto_ptr<HORecHitCollection> rec2(new HORecHitCollection); // Outer 00110 std::auto_ptr<HFRecHitCollection> rec3(new HFRecHitCollection); // Forward 00111 00112 std::auto_ptr<EBDigiCollection> digieb(new EBDigiCollection(1)); 00113 std::auto_ptr<EEDigiCollection> digiee(new EEDigiCollection(1)); 00114 std::auto_ptr<HBHEDigiCollection> digihbhe(new HBHEDigiCollection); 00115 std::auto_ptr<HODigiCollection> digiho(new HODigiCollection); 00116 std::auto_ptr<HFDigiCollection> digihf(new HFDigiCollection); 00117 00118 00119 EcalBarrelRecHitsMaker_->loadEcalBarrelRecHits(iEvent,*receb,*digieb); 00120 00121 EcalEndcapRecHitsMaker_->loadEcalEndcapRecHits(iEvent,*recee,*digiee); 00122 00123 EcalPreshowerRecHitsMaker_->loadEcalPreshowerRecHits(iEvent,*reces); 00124 00125 HcalRecHitsMaker_->loadHcalRecHits(iEvent,*rec1,*rec2,*rec3,*digihbhe,*digiho,*digihf); 00126 00127 iEvent.put(receb,EBrechitCollection_); 00128 iEvent.put(recee,EErechitCollection_); 00129 iEvent.put(reces,ESrechitCollection_); 00130 iEvent.put(rec1); 00131 iEvent.put(rec2); 00132 iEvent.put(rec3); 00133 if(doDigis_) 00134 { 00135 iEvent.put(digihbhe); 00136 iEvent.put(digiho); 00137 iEvent.put(digihf); 00138 iEvent.put(digieb); 00139 iEvent.put(digiee); 00140 } 00141 }
bool CaloRecHitsProducer::doDigis_ [private] |
Definition at line 35 of file CaloRecHitsProducer.h.
Referenced by beginRun(), CaloRecHitsProducer(), and produce().
bool CaloRecHitsProducer::doMiscalib_ [private] |
Definition at line 36 of file CaloRecHitsProducer.h.
Referenced by beginRun(), and CaloRecHitsProducer().
std::string CaloRecHitsProducer::EBrechitCollection_ [private] |
Definition at line 42 of file CaloRecHitsProducer.h.
Referenced by CaloRecHitsProducer(), and produce().
Definition at line 39 of file CaloRecHitsProducer.h.
Referenced by beginRun(), CaloRecHitsProducer(), endJob(), and produce().
Definition at line 40 of file CaloRecHitsProducer.h.
Referenced by beginRun(), CaloRecHitsProducer(), endJob(), and produce().
Definition at line 41 of file CaloRecHitsProducer.h.
Referenced by beginRun(), CaloRecHitsProducer(), endJob(), and produce().
std::string CaloRecHitsProducer::EErechitCollection_ [private] |
Definition at line 43 of file CaloRecHitsProducer.h.
Referenced by CaloRecHitsProducer(), and produce().
std::string CaloRecHitsProducer::ESrechitCollection_ [private] |
Definition at line 44 of file CaloRecHitsProducer.h.
Referenced by CaloRecHitsProducer(), and produce().
Definition at line 38 of file CaloRecHitsProducer.h.
Referenced by beginRun(), CaloRecHitsProducer(), endJob(), and produce().
Definition at line 49 of file CaloRecHitsProducer.h.
const RandomEngine* CaloRecHitsProducer::random [private] |
Definition at line 47 of file CaloRecHitsProducer.h.
Referenced by CaloRecHitsProducer(), and ~CaloRecHitsProducer().