CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

IsolatedTauJetsSelector Class Reference

#include <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.

{

  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.

{ }

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(), 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);


}

Member Data Documentation

Definition at line 25 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

Definition at line 26 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

Definition at line 27 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().

Definition at line 28 of file IsolatedTauJetsSelector.h.

Referenced by IsolatedTauJetsSelector(), and produce().