CMS 3D CMS Logo

IsolatedTauJetsSelector Class Reference

#include <RecoTauTag/HLTProducers/interface/IsolatedTauJetsSelector.h>

Inheritance diagram for IsolatedTauJetsSelector:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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


Detailed Description

Definition at line 17 of file IsolatedTauJetsSelector.h.


Member Typedef Documentation

typedef std::vector<edm::InputTag> IsolatedTauJetsSelector::vtag [private]

Definition at line 24 of file IsolatedTauJetsSelector.h.


Constructor & Destructor Documentation

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.

00011 {
00012 
00013   jetSrc = iConfig.getParameter<vtag>("JetSrc");
00014   pt_min_leadTrack   = iConfig.getParameter<double>("MinimumTransverseMomentumLeadingTrack"); 
00015 useIsolationDiscriminator = iConfig.getParameter<bool>("UseIsolationDiscriminator");
00016  useInHLTOpen       = iConfig.getParameter<bool>("UseInHLTOpen");
00017  
00018   produces<reco::CaloJetCollection>();
00019   //  produces<reco::IsolatedTauTagInfoCollection>();  
00020 }

IsolatedTauJetsSelector::~IsolatedTauJetsSelector (  ) 

Definition at line 22 of file IsolatedTauJetsSelector.cc.

00022 { }


Member Function Documentation

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(), HcalSimpleRecAlgoImpl::reco(), s, std, useInHLTOpen, and useIsolationDiscriminator.

00025 {
00026 
00027   using namespace reco;
00028   using namespace edm;
00029   using namespace std;
00030   
00031   CaloJetCollection * jetCollectionTmp = new CaloJetCollection;
00032 //    IsolatedTauTagInfoCollection * extendedCollection = new IsolatedTauTagInfoCollection;
00033 
00034   for( vtag::const_iterator s = jetSrc.begin(); s != jetSrc.end(); ++ s ) {
00035     edm::Handle<IsolatedTauTagInfoCollection> tauJets;
00036     iEvent.getByLabel( * s, tauJets );
00037     IsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
00038     for(;i !=tauJets->end(); i++ ) {
00039 
00040       if(useInHLTOpen) {
00041         const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get()));
00042         CaloJet* mioPippo = const_cast<CaloJet*>(pippo);
00043         mioPippo->Particle::setPdgId(15);
00044         if(mioPippo)
00045           jetCollectionTmp->push_back(*mioPippo);
00046         //      extendedCollection->push_back(*(i)); //to  be used later
00047         //      delete pippo;
00048       }else{
00049         const TrackRef leadTk = i->leadingSignalTrack();
00050         if( !leadTk ) 
00051           {}else{
00052         if(leadTk->pt() >  pt_min_leadTrack) {     
00053           float discriminator = i->discriminator();       
00054           const CaloJet* pippo = dynamic_cast<const CaloJet*>((i->jet().get()));
00055           CaloJet* mioPippo = const_cast<CaloJet*>(pippo);
00056           mioPippo->Particle::setPdgId(15);
00057           if(useIsolationDiscriminator && (discriminator > 0) ) {
00058             if(mioPippo)
00059               jetCollectionTmp->push_back(*mioPippo);
00060             // delete pippo;
00061           }else if(!useIsolationDiscriminator){
00062             if(mioPippo)
00063               jetCollectionTmp->push_back(*mioPippo);
00064             }
00065           }
00066         }
00067       }
00068     }     
00069   }
00070 
00071 
00072   
00073   auto_ptr<reco::CaloJetCollection> selectedTaus(jetCollectionTmp);
00074 
00075   iEvent.put(selectedTaus);
00076 
00077 
00078 }


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:57 2009 for CMSSW by  doxygen 1.5.4