CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EMIsolatedTauJetsSelector.cc
Go to the documentation of this file.
4 #include "Math/GenVector/VectorUtil.h"
5 //
6 // class decleration
7 //
8 
9 
11 {
12  tauSrc = iConfig.getParameter<std::vector< edm::InputTag > >("TauSrc");
13 
14  produces<reco::CaloJetCollection>("Isolated");
15  produces<reco::CaloJetCollection>("NotIsolated");
16 }
17 
19 
21 {
22 
23  using namespace reco;
24  using namespace edm;
25  using namespace std;
26 
27 typedef std::vector<edm::InputTag> vtag;
28  auto_ptr<reco::CaloJetCollection> isolatedTaus(new CaloJetCollection);
29  auto_ptr<reco::CaloJetCollection> notIsolatedTaus(new CaloJetCollection);
30 
31  for( vtag::const_iterator s = tauSrc.begin(); s != tauSrc.end(); ++ s ) {
33  iEvent.getByLabel( * s, tauJets );
34  EMIsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
35  for(;i !=tauJets->end(); i++ ) {
36  double discriminator = (*i).discriminator();
37  if(discriminator > 0) {
38  const CaloJet* pippo = dynamic_cast<const CaloJet*>(i->jet().get());
39  isolatedTaus->push_back(*pippo );
40  }else{
41  const CaloJet* notPippo =dynamic_cast<const CaloJet*>(i->jet().get());
42 
43  notIsolatedTaus->push_back(*notPippo );
44  }
45  }
46  }
47 
48 
49 
50  iEvent.put(isolatedTaus, "Isolated");
51  iEvent.put(notIsolatedTaus,"NotIsolated");
52 
53 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:30
virtual void produce(edm::Event &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
EMIsolatedTauJetsSelector(const edm::ParameterSet &)
string s
Definition: asciidump.py:422
std::vector< edm::InputTag > tauSrc
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects