Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:49

0001 // -*- C++ -*-
0002 //
0003 // Package:    PATHeavyIonProducer
0004 // Class:      PATHeavyIonProducer
0005 //
0006 /**\class PATHeavyIonProducer PATHeavyIonProducer.cc yetkin/PATHeavyIonProducer/src/PATHeavyIonProducer.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Yetkin Yilmaz
0015 //         Created:  Thu Aug 13 08:39:51 EDT 2009
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 #include <string>
0022 #include <iostream>
0023 
0024 // user include files
0025 #include "FWCore/Framework/interface/Frameworkfwd.h"
0026 #include "FWCore/Framework/interface/global/EDProducer.h"
0027 
0028 #include "FWCore/Framework/interface/Event.h"
0029 #include "FWCore/Framework/interface/MakerMacros.h"
0030 
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 #include "FWCore/Utilities/interface/InputTag.h"
0033 
0034 #include "DataFormats/HeavyIonEvent/interface/HeavyIon.h"
0035 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0036 
0037 #include "HepMC/HeavyIon.h"
0038 
0039 using namespace std;
0040 
0041 //
0042 // class decleration
0043 //
0044 
0045 class PATHeavyIonProducer : public edm::global::EDProducer<> {
0046 public:
0047   explicit PATHeavyIonProducer(const edm::ParameterSet&);
0048   ~PATHeavyIonProducer() override;
0049 
0050 private:
0051   void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
0052   // ----------member data ---------------------------
0053 
0054   const bool doMC_;
0055   const bool doReco_;
0056   const std::vector<std::string> hepmcSrc_;
0057   const edm::InputTag centSrc_;
0058   const edm::InputTag evtPlaneSrc_;
0059 };
0060 
0061 //
0062 // constants, enums and typedefs
0063 //
0064 
0065 //
0066 // static data member definitions
0067 //
0068 
0069 //
0070 // constructors and destructor
0071 //
0072 PATHeavyIonProducer::PATHeavyIonProducer(const edm::ParameterSet& iConfig)
0073     : doMC_(iConfig.getParameter<bool>("doMC")),
0074       doReco_(iConfig.getParameter<bool>("doReco")),
0075       hepmcSrc_(doMC_ ? iConfig.getParameter<std::vector<std::string> >("generators") : std::vector<std::string>()),
0076       centSrc_(doReco_ ? iConfig.getParameter<edm::InputTag>("centrality") : edm::InputTag()),
0077       evtPlaneSrc_(doReco_ ? iConfig.getParameter<edm::InputTag>("evtPlane") : edm::InputTag()) {
0078   //register your products
0079   produces<pat::HeavyIon>();
0080 }
0081 
0082 PATHeavyIonProducer::~PATHeavyIonProducer() {
0083   // do anything here that needs to be done at desctruction time
0084   // (e.g. close files, deallocate resources etc.)
0085 }
0086 
0087 //
0088 // member functions
0089 //
0090 
0091 // ------------ method called to produce the data  ------------
0092 void PATHeavyIonProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const {}
0093 
0094 //define this as a plug-in
0095 DEFINE_FWK_MODULE(PATHeavyIonProducer);