#include <IsolatedTauJetsSelector.h>
Public Member Functions | |
IsolatedTauJetsSelector (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~IsolatedTauJetsSelector () | |
Private Types | |
typedef std::vector < edm::InputTag > | vtag |
Private Attributes | |
vtag | jetSrc |
double | pt_min_leadTrack |
bool | useInHLTOpen |
bool | useIsolationDiscriminator |
Definition at line 17 of file IsolatedTauJetsSelector.h.
typedef std::vector<edm::InputTag> IsolatedTauJetsSelector::vtag [private] |
Definition at line 24 of file IsolatedTauJetsSelector.h.
IsolatedTauJetsSelector::IsolatedTauJetsSelector | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 10 of file IsolatedTauJetsSelector.cc.
References edm::ParameterSet::getParameter(), jetSrc, pt_min_leadTrack, useInHLTOpen, and useIsolationDiscriminator.
{ jetSrc = iConfig.getParameter<vtag>("JetSrc"); pt_min_leadTrack = iConfig.getParameter<double>("MinimumTransverseMomentumLeadingTrack"); useIsolationDiscriminator = iConfig.getParameter<bool>("UseIsolationDiscriminator"); useInHLTOpen = iConfig.getParameter<bool>("UseInHLTOpen"); produces<reco::CaloJetCollection>(); // produces<reco::IsolatedTauTagInfoCollection>(); }
IsolatedTauJetsSelector::~IsolatedTauJetsSelector | ( | ) |
Definition at line 22 of file IsolatedTauJetsSelector.cc.
{ }
void IsolatedTauJetsSelector::produce | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iES | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 24 of file IsolatedTauJetsSelector.cc.
References edm::Event::getByLabel(), i, jetSrc, pt_min_leadTrack, edm::Event::put(), dt_offlineAnalysis_common_cff::reco, asciidump::s, reco::LeafCandidate::setPdgId(), useInHLTOpen, and useIsolationDiscriminator.
{ using namespace reco; using namespace edm; using namespace std; CaloJetCollection * jetCollectionTmp = new CaloJetCollection; // IsolatedTauTagInfoCollection * extendedCollection = new IsolatedTauTagInfoCollection; for( vtag::const_iterator s = jetSrc.begin(); s != jetSrc.end(); ++ s ) { edm::Handle<IsolatedTauTagInfoCollection> tauJets; iEvent.getByLabel( * s, tauJets ); IsolatedTauTagInfoCollection::const_iterator i = tauJets->begin(); for(;i !=tauJets->end(); i++ ) { if(useInHLTOpen) { const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get())); CaloJet* mioPippo = const_cast<CaloJet*>(pippo); mioPippo->setPdgId(15); if(mioPippo) jetCollectionTmp->push_back(*mioPippo); // extendedCollection->push_back(*(i)); //to be used later // delete pippo; }else{ const TrackRef leadTk = i->leadingSignalTrack(); if( !leadTk ) {}else{ if(leadTk->pt() > pt_min_leadTrack) { float discriminator = i->discriminator(); const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get())); CaloJet* mioPippo = const_cast<CaloJet*>(pippo); mioPippo->setPdgId(15); if(useIsolationDiscriminator && (discriminator > 0) ) { if(mioPippo) jetCollectionTmp->push_back(*mioPippo); // delete pippo; }else if(!useIsolationDiscriminator){ if(mioPippo) jetCollectionTmp->push_back(*mioPippo); } } } } } } auto_ptr<reco::CaloJetCollection> selectedTaus(jetCollectionTmp); iEvent.put(selectedTaus); }
vtag IsolatedTauJetsSelector::jetSrc [private] |
Definition at line 25 of file IsolatedTauJetsSelector.h.
Referenced by IsolatedTauJetsSelector(), and produce().
double IsolatedTauJetsSelector::pt_min_leadTrack [private] |
Definition at line 26 of file IsolatedTauJetsSelector.h.
Referenced by IsolatedTauJetsSelector(), and produce().
bool IsolatedTauJetsSelector::useInHLTOpen [private] |
Definition at line 27 of file IsolatedTauJetsSelector.h.
Referenced by IsolatedTauJetsSelector(), and produce().
bool IsolatedTauJetsSelector::useIsolationDiscriminator [private] |
Definition at line 28 of file IsolatedTauJetsSelector.h.
Referenced by IsolatedTauJetsSelector(), and produce().