CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/RecoTauTag/TauTagTools/plugins/RecoTauEventFlagProducer.cc

Go to the documentation of this file.
00001 /*
00002  * Produce an int in the event that specifies an event type.
00003  *
00004  * Takes one int parameter: flag, and puts it in the event
00005  *
00006  * Used to identify different samples in MVA training.
00007  *
00008  * Author: Evan K. Friis, UC Davis
00009  *
00010  */
00011 
00012 #include "FWCore/Framework/interface/EDProducer.h"
00013 #include "FWCore/Framework/interface/EventSetup.h"
00014 #include "FWCore/Framework/interface/ESHandle.h"
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00017 
00018 class RecoTauEventFlagProducer : public edm::EDProducer {
00019   public:
00020     RecoTauEventFlagProducer(const edm::ParameterSet &pset) {
00021       flag_ = pset.getParameter<int>("flag");
00022       produces<int>();
00023     }
00024     ~RecoTauEventFlagProducer() {}
00025     void produce(edm::Event& evt, const edm::EventSetup &es) {
00026       std::auto_ptr<int> toput(new int(flag_));
00027       evt.put(toput);
00028     }
00029   private:
00030     int flag_;
00031 };
00032 
00033 #include "FWCore/Framework/interface/MakerMacros.h"
00034 DEFINE_FWK_MODULE(RecoTauEventFlagProducer);