CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/RecoTauTag/HLTProducers/src/EMIsolatedTauJetsSelector.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/HLTProducers/interface/EMIsolatedTauJetsSelector.h"
00002 #include "DataFormats/JetReco/interface/JetTracksAssociation.h"
00003 #include "DataFormats/VertexReco/interface/Vertex.h"
00004 #include "Math/GenVector/VectorUtil.h"
00005 //
00006 // class decleration
00007 //
00008 
00009 
00010 EMIsolatedTauJetsSelector::EMIsolatedTauJetsSelector(const edm::ParameterSet& iConfig)
00011 {
00012   tauSrc      = iConfig.getParameter<std::vector< edm::InputTag > >("TauSrc");
00013    
00014   produces<reco::CaloJetCollection>("Isolated");
00015   produces<reco::CaloJetCollection>("NotIsolated");
00016 }
00017 
00018 EMIsolatedTauJetsSelector::~EMIsolatedTauJetsSelector(){ }
00019 
00020 void EMIsolatedTauJetsSelector::produce(edm::Event& iEvent, const edm::EventSetup& iES)
00021 {
00022 
00023   using namespace reco;
00024   using namespace edm;
00025   using namespace std;
00026   
00027 typedef std::vector<edm::InputTag> vtag;
00028  std::auto_ptr<reco::CaloJetCollection> isolatedTaus(new CaloJetCollection); 
00029  std::auto_ptr<reco::CaloJetCollection> notIsolatedTaus(new CaloJetCollection);
00030  
00031   for( vtag::const_iterator s = tauSrc.begin(); s != tauSrc.end(); ++ s ) {
00032     edm::Handle<EMIsolatedTauTagInfoCollection> tauJets;
00033     iEvent.getByLabel( * s, tauJets );
00034     EMIsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
00035     for(;i !=tauJets->end(); i++ ) {
00036       double discriminator = (*i).discriminator();
00037       if(discriminator > 0) {
00038         const CaloJet* pippo = dynamic_cast<const CaloJet*>(i->jet().get());
00039         isolatedTaus->push_back(*pippo );
00040       }else{
00041         const CaloJet* notPippo =dynamic_cast<const CaloJet*>(i->jet().get());
00042 
00043         notIsolatedTaus->push_back(*notPippo );
00044       }
00045     }
00046   }
00047   
00048   
00049 
00050   iEvent.put(isolatedTaus, "Isolated");
00051   iEvent.put(notIsolatedTaus,"NotIsolated");
00052   
00053 }