00001 // -*- C++ -*- 00002 // 00003 // Package: PATHeavyIonProducer 00004 // Class: PATHeavyIonProducer 00005 // 00013 // 00014 // Original Author: Yetkin Yilmaz 00015 // Created: Thu Aug 13 08:39:51 EDT 2009 00016 // $Id: PATHeavyIonProducer.cc,v 1.3 2010/05/04 16:18:32 yilmaz Exp $ 00017 // 00018 // 00019 00020 00021 // system include files 00022 #include <memory> 00023 #include <string> 00024 #include <iostream> 00025 00026 // user include files 00027 #include "FWCore/Framework/interface/Frameworkfwd.h" 00028 #include "FWCore/Framework/interface/EDProducer.h" 00029 00030 #include "FWCore/Framework/interface/Event.h" 00031 #include "FWCore/Framework/interface/MakerMacros.h" 00032 00033 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00034 #include "FWCore/Utilities/interface/InputTag.h" 00035 00036 #include "DataFormats/HeavyIonEvent/interface/HeavyIon.h" 00037 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h" 00038 00039 #include "HepMC/HeavyIon.h" 00040 00041 using namespace std; 00042 00043 // 00044 // class decleration 00045 // 00046 00047 class PATHeavyIonProducer : public edm::EDProducer { 00048 public: 00049 explicit PATHeavyIonProducer(const edm::ParameterSet&); 00050 ~PATHeavyIonProducer(); 00051 00052 private: 00053 virtual void beginJob() ; 00054 virtual void produce(edm::Event&, const edm::EventSetup&); 00055 virtual void endJob() ; 00056 00057 // ----------member data --------------------------- 00058 00059 bool doMC_; 00060 bool doReco_; 00061 std::vector<std::string> hepmcSrc_; 00062 edm::InputTag centSrc_; 00063 edm::InputTag evtPlaneSrc_; 00064 00065 }; 00066 00067 // 00068 // constants, enums and typedefs 00069 // 00070 00071 00072 // 00073 // static data member definitions 00074 // 00075 00076 // 00077 // constructors and destructor 00078 // 00079 PATHeavyIonProducer::PATHeavyIonProducer(const edm::ParameterSet& iConfig) 00080 { 00081 //register your products 00082 produces<pat::HeavyIon>(); 00083 00084 //now do what ever other initialization is needed 00085 doReco_ = iConfig.getParameter<bool>("doReco"); 00086 if(doReco_){ 00087 centSrc_ = iConfig.getParameter<edm::InputTag>("centrality"); 00088 evtPlaneSrc_ = iConfig.getParameter<edm::InputTag>("evtPlane"); 00089 } 00090 00091 doMC_ = iConfig.getParameter<bool>("doMC"); 00092 if(doMC_){ 00093 hepmcSrc_ = iConfig.getParameter<std::vector<std::string> >("generators"); 00094 } 00095 00096 } 00097 00098 00099 PATHeavyIonProducer::~PATHeavyIonProducer() 00100 { 00101 00102 // do anything here that needs to be done at desctruction time 00103 // (e.g. close files, deallocate resources etc.) 00104 00105 } 00106 00107 00108 // 00109 // member functions 00110 // 00111 00112 // ------------ method called to produce the data ------------ 00113 void 00114 PATHeavyIonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) 00115 { 00116 00117 } 00118 00119 // ------------ method called once each job just before starting event loop ------------ 00120 void 00121 PATHeavyIonProducer::beginJob() 00122 { 00123 } 00124 00125 // ------------ method called once each job just after ending the event loop ------------ 00126 void 00127 PATHeavyIonProducer::endJob() { 00128 } 00129 00130 //define this as a plug-in 00131 DEFINE_FWK_MODULE(PATHeavyIonProducer);