CMS 3D CMS Logo

Public Member Functions | Private Attributes

EMIsolatedTauJetsSelector Class Reference

#include <EMIsolatedTauJetsSelector.h>

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

List of all members.

Public Member Functions

 EMIsolatedTauJetsSelector (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~EMIsolatedTauJetsSelector ()

Private Attributes

std::vector< edm::InputTagtauSrc

Detailed Description

Definition at line 18 of file EMIsolatedTauJetsSelector.h.


Constructor & Destructor Documentation

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

Definition at line 10 of file EMIsolatedTauJetsSelector.cc.

References edm::ParameterSet::getParameter(), and tauSrc.

{
  tauSrc      = iConfig.getParameter<std::vector< edm::InputTag > >("TauSrc");
   
  produces<reco::CaloJetCollection>("Isolated");
  produces<reco::CaloJetCollection>("NotIsolated");
}
EMIsolatedTauJetsSelector::~EMIsolatedTauJetsSelector ( )

Definition at line 18 of file EMIsolatedTauJetsSelector.cc.

{ }

Member Function Documentation

void EMIsolatedTauJetsSelector::produce ( edm::Event iEvent,
const edm::EventSetup iES 
) [virtual]

Implements edm::EDProducer.

Definition at line 20 of file EMIsolatedTauJetsSelector.cc.

References edm::Event::getByLabel(), i, edm::Event::put(), dt_offlineAnalysis_common_cff::reco, asciidump::s, and tauSrc.

{

  using namespace reco;
  using namespace edm;
  using namespace std;
  
typedef std::vector<edm::InputTag> vtag;
 auto_ptr<reco::CaloJetCollection> isolatedTaus(new CaloJetCollection); 
 auto_ptr<reco::CaloJetCollection> notIsolatedTaus(new CaloJetCollection);
 
  for( vtag::const_iterator s = tauSrc.begin(); s != tauSrc.end(); ++ s ) {
    edm::Handle<EMIsolatedTauTagInfoCollection> tauJets;
    iEvent.getByLabel( * s, tauJets );
    EMIsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
    for(;i !=tauJets->end(); i++ ) {
      double discriminator = (*i).discriminator();
      if(discriminator > 0) {
        const CaloJet* pippo = dynamic_cast<const CaloJet*>(i->jet().get());
        isolatedTaus->push_back(*pippo );
      }else{
        const CaloJet* notPippo =dynamic_cast<const CaloJet*>(i->jet().get());

        notIsolatedTaus->push_back(*notPippo );
      }
    }
  }
  
  

  iEvent.put(isolatedTaus, "Isolated");
  iEvent.put(notIsolatedTaus,"NotIsolated");
  
}

Member Data Documentation

Definition at line 25 of file EMIsolatedTauJetsSelector.h.

Referenced by EMIsolatedTauJetsSelector(), and produce().