test
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  typedef std::vector<edm::InputTag> vtag;
14  for(vtag::const_iterator it = tauSrc.begin(); it != tauSrc.end(); ++it) {
15  edm::EDGetTokenT<reco::EMIsolatedTauTagInfoCollection> aToken = consumes<reco::EMIsolatedTauTagInfoCollection>(*it);
16  tauSrc_token.push_back(aToken);
17  }
18 
19  produces<reco::CaloJetCollection>("Isolated");
20  produces<reco::CaloJetCollection>("NotIsolated");
21 }
22 
24 
26 {
27 
28  using namespace reco;
29  using namespace edm;
30  using namespace std;
31 
32  std::auto_ptr<reco::CaloJetCollection> isolatedTaus(new CaloJetCollection);
33  std::auto_ptr<reco::CaloJetCollection> notIsolatedTaus(new CaloJetCollection);
34 
35  typedef std::vector<edm::EDGetTokenT<reco::EMIsolatedTauTagInfoCollection> > vtag_token;
36  for( vtag_token::const_iterator s = tauSrc_token.begin(); s != tauSrc_token.end(); ++ s ) {
38  iEvent.getByToken( * s, tauJets );
39  EMIsolatedTauTagInfoCollection::const_iterator i = tauJets->begin();
40  for(;i !=tauJets->end(); i++ ) {
41  double discriminator = (*i).discriminator();
42  if(discriminator > 0) {
43  const CaloJet* pippo = dynamic_cast<const CaloJet*>(i->jet().get());
44  isolatedTaus->push_back(*pippo );
45  }else{
46  const CaloJet* notPippo =dynamic_cast<const CaloJet*>(i->jet().get());
47 
48  notIsolatedTaus->push_back(*notPippo );
49  }
50  }
51  }
52 
53 
54 
55  iEvent.put(isolatedTaus, "Isolated");
56  iEvent.put(notIsolatedTaus,"NotIsolated");
57 
58 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual void produce(edm::Event &, const edm::EventSetup &) override
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
std::vector< edm::EDGetTokenT< reco::EMIsolatedTauTagInfoCollection > > tauSrc_token
EMIsolatedTauJetsSelector(const edm::ParameterSet &)
std::vector< edm::InputTag > tauSrc
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects