CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

Public Member Functions

 RecoTracksMixer (const edm::ParameterSet &)
 
 ~RecoTracksMixer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

66  :
67  _tracks1(iConfig.getParameter< edm::InputTag > ("trackCol1")),
68  _tracks2(iConfig.getParameter< edm::InputTag > ("trackCol2"))
69 {
70 
71  produces<reco::TrackCollection>();
72 }
T getParameter(std::string const &) const
edm::InputTag _tracks2
edm::InputTag _tracks1
RecoTracksMixer::~RecoTracksMixer ( )

Definition at line 75 of file RecoTracksMixer.cc.

76 {
77 
78  // do anything here that needs to be done at desctruction time
79  // (e.g. close files, deallocate resources etc.)
80 
81 }

Member Function Documentation

void RecoTracksMixer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 132 of file RecoTracksMixer.cc.

133 {
134 }
void RecoTracksMixer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 138 of file RecoTracksMixer.cc.

138  {
139 }
void RecoTracksMixer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 90 of file RecoTracksMixer.cc.

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

91 {
92  using namespace edm;
93 
94  std::vector< edm::Handle<reco::TrackCollection> > cols;
96  iEvent.getByLabel( _tracks1, tks1);
97 
99  iEvent.getByLabel( _tracks2, tks2);
100 
101  cols.push_back(tks1);
102  cols.push_back(tks2);
103 
104  std::auto_ptr< reco::TrackCollection > newCol(new reco::TrackCollection );
105 
106  //std::cout << "##########################################\n";
107  //int i = 0;
108  std::vector< edm::Handle<reco::TrackCollection> >::iterator it = cols.begin();
109  for(;it != cols.end(); ++it)
110  {
111  //std::cout << " col " << i++ << std::endl;
112  for ( reco::TrackCollection::const_iterator itT = (*it)->begin() ; itT != (*it)->end(); ++itT)
113  {
114  /*
115  std::cout << " " << itT->vx()
116  << " " << itT->vy()
117  << " " << itT->vz()
118  << " " << itT->pt()
119  << std::endl;*/
120 
121  newCol->push_back(*itT);
122  }
123 
124  }
125 
126  iEvent.put(newCol);
127 
128 }
edm::InputTag _tracks2
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
edm::InputTag _tracks1
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356

Member Data Documentation

edm::InputTag RecoTracksMixer::_tracks1
private

Definition at line 48 of file RecoTracksMixer.cc.

Referenced by produce().

edm::InputTag RecoTracksMixer::_tracks2
private

Definition at line 49 of file RecoTracksMixer.cc.

Referenced by produce().