CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

RecoTracksMixer Class Reference

#include <TauAnalysis/RecoTracksMixer/src/RecoTracksMixer.cc>

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

List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

edm::InputTag _tracks1
edm::InputTag _tracks2

Detailed Description

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

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

Definition at line 39 of file RecoTracksMixer.cc.


Constructor & Destructor Documentation

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

Definition at line 66 of file RecoTracksMixer.cc.

                                                               :
  _tracks1(iConfig.getParameter< edm::InputTag > ("trackCol1")),
  _tracks2(iConfig.getParameter< edm::InputTag > ("trackCol2"))
{

   produces<reco::TrackCollection>();
}
RecoTracksMixer::~RecoTracksMixer ( )

Definition at line 75 of file RecoTracksMixer.cc.

{

   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 132 of file RecoTracksMixer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 138 of file RecoTracksMixer.cc.

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

Implements edm::EDProducer.

Definition at line 90 of file RecoTracksMixer.cc.

References _tracks1, _tracks2, edm::Event::getByLabel(), and edm::Event::put().

{
   using namespace edm;

   std::vector< edm::Handle<reco::TrackCollection> > cols;
   edm::Handle<reco::TrackCollection> tks1;
   iEvent.getByLabel( _tracks1, tks1);

   edm::Handle<reco::TrackCollection> tks2;
   iEvent.getByLabel( _tracks2, tks2);

   cols.push_back(tks1);
   cols.push_back(tks2);

   std::auto_ptr< reco::TrackCollection  > newCol(new reco::TrackCollection );

   //std::cout << "##########################################\n";
   //int i  = 0;
   std::vector< edm::Handle<reco::TrackCollection> >::iterator it = cols.begin();
   for(;it != cols.end(); ++it)
   {
     //std::cout << " col " << i++ << std::endl;
     for ( reco::TrackCollection::const_iterator itT = (*it)->begin() ; itT != (*it)->end(); ++itT)
     {
       /*
       std::cout << " " << itT->vx()
           << " " << itT->vy()
           << " " << itT->vz()
           << " " << itT->pt()
           << std::endl;*/

       newCol->push_back(*itT);
     }

   }

   iEvent.put(newCol);

}

Member Data Documentation

Definition at line 48 of file RecoTracksMixer.cc.

Referenced by produce().

Definition at line 49 of file RecoTracksMixer.cc.

Referenced by produce().