CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

V0Producer Class Reference

#include <MyProducers/V0Producer/src/V0Producer.cc>

Inheritance diagram for V0Producer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 V0Producer (const edm::ParameterSet &)
 ~V0Producer ()

Private Member Functions

virtual void beginJob ()
virtual void endJob ()
virtual void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

edm::ParameterSet theParams

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 43 of file V0Producer.h.


Constructor & Destructor Documentation

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

Definition at line 27 of file V0Producer.cc.

                                                     :
  theParams(iConfig) {

   // Registering V0 Collections
  //produces<reco::VertexCollection>("Kshort");
  //produces<reco::VertexCollection>("Lambda");
  //produces<reco::VertexCollection>("LambdaBar");

  // Trying this with Candidates instead of the simple reco::Vertex
  produces< reco::VertexCompositeCandidateCollection >("Kshort");
  produces< reco::VertexCompositeCandidateCollection >("Lambda");
  //produces< reco::VertexCompositeCandidateCollection >("LambdaBar");

}
V0Producer::~V0Producer ( )

Definition at line 43 of file V0Producer.cc.

                        {

}

Member Function Documentation

void V0Producer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 84 of file V0Producer.cc.

                          {
}
void V0Producer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 88 of file V0Producer.cc.

                        {
}
void V0Producer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 53 of file V0Producer.cc.

References filterCSVwithJSON::copy, V0Fitter::getKshorts(), V0Fitter::getLambdas(), edm::Event::put(), and theParams.

                                                                      {
   using namespace edm;

   // Create V0Fitter object which reconstructs the vertices and creates
   //  (and contains) collections of Kshorts, Lambda0s
   V0Fitter theVees(theParams, iEvent, iSetup);

   // Create auto_ptr for each collection to be stored in the Event
   std::auto_ptr< reco::VertexCompositeCandidateCollection > 
     kShortCandidates( new reco::VertexCompositeCandidateCollection );
   kShortCandidates->reserve( theVees.getKshorts().size() ); 

   std::auto_ptr< reco::VertexCompositeCandidateCollection >
     lambdaCandidates( new reco::VertexCompositeCandidateCollection );
   lambdaCandidates->reserve( theVees.getLambdas().size() );

   std::copy( theVees.getKshorts().begin(),
              theVees.getKshorts().end(),
              std::back_inserter(*kShortCandidates) );
   std::copy( theVees.getLambdas().begin(),
              theVees.getLambdas().end(),
              std::back_inserter(*lambdaCandidates) );

   // Write the collections to the Event
   iEvent.put( kShortCandidates, std::string("Kshort") );
   iEvent.put( lambdaCandidates, std::string("Lambda") );

}

Member Data Documentation

Definition at line 54 of file V0Producer.h.

Referenced by produce().