CMS 3D CMS Logo

Public Member Functions | Private Attributes

pat::__class__Producer Class Reference

#include <EventHypothesisProducer.h>

Inheritance diagram for pat::__class__Producer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 __class__Producer (const edm::ParameterSet &iConfig)
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 ~__class__Producer ()

Private Attributes

edm::InputTag electronSrc_
edm::InputTag jetSrc_
edm::InputTag metSrc_
edm::InputTag muonSrc_
edm::OutputTag outputName_
edm::InputTag photonSrc_
edm::InputTag tauSrc_

Detailed Description

Definition at line 39 of file EventHypothesisProducer.h.


Constructor & Destructor Documentation

__class__Producer::__class__Producer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 8 of file EventHypothesisProducer.cc.

References electronSrc_, edm::ParameterSet::getParameter(), jetSrc_, metSrc_, muonSrc_, outputName_, photonSrc_, and tauSrc_.

                                                                    : 
  public edm::EDProducer(iConfig)
{

  // Here we get the list of common includes
  muonSrc_      = iConfig.getParameter<edm::InputTag>( "muonSource"     );
  electronSrc_  = iConfig.getParameter<edm::InputTag>( "electronSource" );
  tauSrc_       = iConfig.getParameter<edm::InputTag>( "tauSource"      );
  photonSrc_    = iConfig.getParameter<edm::InputTag>( "photonSource"   );
  jetSrc_       = iConfig.getParameter<edm::InputTag>( "jetSource"      );
  metSrc_       = iConfig.getParameter<edm::InputTag>( "metSource"      );

  // Here we get the output tag name
  outputName_   = iConfig.getParameter<edm::OutputTag>("outputName");
  
  // This declares the output to the event stream
  string alias;
  produces<std::vector<__class__> >(alias = outputName_).setBranchAddress(alias);
}
__class__Producer::~__class__Producer ( )

Definition at line 28 of file EventHypothesisProducer.cc.

{
}

Member Function Documentation

__class__Producer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDProducer.

Definition at line 32 of file EventHypothesisProducer.cc.

References HI_PhotonSkim_cff::electrons, electronSrc_, edm::Event::getByLabel(), fwrapper::jets, jetSrc_, metSrc_, patZpeak::muons, muonSrc_, outputName_, interactiveExample::photons, photonSrc_, edm::Event::put(), and tauSrc_.

{

  // Here is the vector where you should put your hypotheses
  std::vector<__class__ hyps;
  

  // ------------------------------------------------------------------------
  // Here is where you get the objects you need. The perl script will
  // uncomment any that you need by reading the event hypothesis text file
  // ------------------------------------------------------------------------

  edm::Handle<std::vector<pat::Muon> >     muons;
  iEvent.getByLabel(muonSrc_,              muons);

  edm::Handle<std::vector<pat::Electron> > electrons;
  iEvent.getByLabel(electronSrc_,          electrons);

  edm::Handle<std::vector<pat::Tau> >      taus;
  iEvent.getByLabel(tauSrc_,               taus);

  edm::Handle<std::vector<pat::Photon> >   photons;
  iEvent.getByLabel(photonSrc_,            photons);

  edm::Handle<std::vector<pat::Jet> >      jets;
  iEvent.getByLabel(jetSrc_,               jets);

  edm::Handle<std::vector<pat::Met> >      mets;
  iEvent.getByLabel(metSrc_,               mets);

  
  // ------------------------------------------------------------------------
  // ****** Here is where you put your event hypothesis code ******
  // ------------------------------------------------------------------------
  // A: Define a combinatorics loop.
  // Replace for ( ...;...;...) with your appropriate loop over objects, such as
  // for ( vector<Muon>::iterator imuon = muons->begin(); imuon != muons->end(); imuon++ ) 
  //    for ( vector<Muon>::iterator jmuon = imuon + 1; jmuon != muons->end(); jmuon++ )
  //   
  for ( ...; ...; ... ) {
    __class__ hyp;

    // B: Fill "hyp" with your hypothesis information and push it back to the
    // vector containing them.
    // For instance, 
    // hyp.muon1() = *imuon;
    // hyp.muon2() = *jmuon;
    // hyp.jets() = *jets;

    hyps.push_back( hyp );
  }  


  // Here is where we write the hypotheses to the event stream
  std::auto_ptr<std::vector<__class__> > ap_hyps( hyps );
  iEvent.put( ap_hyps, outputName_);

}

Member Data Documentation

Definition at line 52 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

Definition at line 55 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

Definition at line 56 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

Definition at line 51 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

edm::OutputTag pat::__class__Producer::outputName_ [private]

Definition at line 58 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

Definition at line 54 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

Definition at line 53 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().