CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

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

#include <IsolationProducerNew.h>

Inheritance diagram for reco::modulesNew::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::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
class reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >

Definition at line 40 of file IsolationProducerNew.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 52 of file IsolationProducerNew.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 60 of file IsolationProducerNew.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 64 of file IsolationProducerNew.h.

References asciidump::elements, edm::Event::getByLabel(), i, init, funct::master(), 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);
      
      ::helper::MasterCollection<C1> master(src);
      auto_ptr<OutputCollection> isolations(new OutputCollection);
      if(src->size()!= 0) {
        typename OutputCollection::Filler filler(*isolations);
        vector<double> iso(master.size(),-1);
        size_t i = 0;
        for( typename C1::const_iterator lep = src->begin(); lep != src->end(); ++ lep )
          iso[master.index(i++)] = alg_(*lep, *elements); 
        filler.insert(master.get(), iso.begin(), iso.end());
        filler.fill();
      }
      evt.put( isolations );
    }

Member Data Documentation

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
Alg reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::alg_ [private]

Definition at line 48 of file IsolationProducerNew.h.

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::InputTag reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::elements_ [private]

Definition at line 47 of file IsolationProducerNew.h.

template<typename C1 , typename C2 , typename Alg , typename OutputCollection = edm::ValueMap<float>, typename Setup = typename helper::IsolationAlgorithmSetup<Alg>::type>
edm::InputTag reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::src_ [private]

Definition at line 47 of file IsolationProducerNew.h.