CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

IsolationProducer< C1, C2, Alg, OutputCollection, Setup > Class Template Reference

#include <IsolationProducer.h>

Inheritance diagram for IsolationProducer< C1, C2, Alg, OutputCollection, Setup >:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

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

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

Alg alg_
edm::InputTag elements_
edm::InputTag src_

Detailed Description

template<typename C1, typename C2, typename Alg, typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
class IsolationProducer< C1, C2, Alg, OutputCollection, Setup >

Definition at line 37 of file IsolationProducer.h.


Constructor & Destructor Documentation

template<typename C1 , typename C2 , typename Alg , typename OutputCollection , typename Setup >
IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::IsolationProducer ( const edm::ParameterSet cfg)

Definition at line 49 of file IsolationProducer.h.

                                                                                                        :
  src_( cfg.template getParameter<edm::InputTag>( "src" ) ),
  elements_( cfg.template getParameter<edm::InputTag>( "elements" ) ),
  alg_( reco::modules::make<Alg>( cfg ) ) {
  produces<OutputCollection>();
}
template<typename C1 , typename C2 , typename Alg , typename OutputCollection , typename Setup >
IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::~IsolationProducer ( )

Definition at line 57 of file IsolationProducer.h.

                                                                            {
}

Member Function Documentation

template<typename C1 , typename C2 , typename Alg , typename OutputCollection , typename Setup >
void IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce ( edm::Event evt,
const edm::EventSetup es 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 61 of file IsolationProducer.h.

References asciidump::elements, edm::Event::getByLabel(), i, init, edm::Event::put(), and align_tpl::src.

                                                                                                              {
  using namespace edm;
  using namespace std;
  Handle<C1> src;
  Handle<C2> elements;
  evt.getByLabel( src_, src );
  evt.getByLabel( elements_, elements );

  Setup::init( alg_, es );

  typename OutputCollection::refprod_type ref( src );
  auto_ptr<OutputCollection> isolations( new OutputCollection( ref )  );

  size_t i = 0;
  for( typename C1::const_iterator lep = src->begin(); lep != src->end(); ++ lep ) {
    typename Alg::value_type iso= alg_(*lep,*elements); 
    isolations->setValue( i++, iso );
  }
  evt.put( isolations );
}

Member Data Documentation

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
Alg IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::alg_ [private]

Definition at line 45 of file IsolationProducer.h.

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::InputTag IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::elements_ [private]

Definition at line 44 of file IsolationProducer.h.

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::AssociationVector<edm::RefProd<C1>, std::vector<typename Alg::value_type> >, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::InputTag IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::src_ [private]

Definition at line 44 of file IsolationProducer.h.