CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetVetoedTracksAssociatorAtVertex.cc
Go to the documentation of this file.
1 // \class JetVetoedTracksAssociatorAtVertex JetTracksAssociatorAtVertex.cc
2 //
3 // Original Author: Andrea Rizzi
4 // Created: Wed Apr 12 11:12:49 CEST 2006
5 // Accommodated for Jet Package by: Fedor Ratnikov Jul. 30, 2007
6 // $Id: JetVetoedTracksAssociatorAtVertex.cc,v 1.4 2010/02/20 21:02:06 wmtan Exp $
7 //
8 //
9 
15 
22 
24 
26 {
27 public:
30  virtual void produce(edm::Event&, const edm::EventSetup&);
31 private:
36 };
37 
39  : mJets (fConfig.getParameter<edm::InputTag> ("jets")),
40  mTracks (fConfig.getParameter<edm::InputTag> ("tracks")),
41  mAssociator (fConfig.getParameter<double> ("coneSize")),
42  classifier(fConfig)
43 {
44  produces<reco::JetTracksAssociation::Container> ();
45 }
46 
48 
50 {
51  // Gather contextual information for TrackCategories
52  classifier.newEvent(fEvent, fSetup);
53 
55  fEvent.getByLabel (mJets, jets_h);
57  fEvent.getByLabel (mTracks, tracks_h);
58 
59  std::auto_ptr<reco::JetTracksAssociation::Container> jetTracks (new reco::JetTracksAssociation::Container (reco::JetRefBaseProd(jets_h)));
60 
61  // format inputs
62  std::vector <edm::RefToBase<reco::Jet> > allJets;
63  allJets.reserve (jets_h->size());
64  for (unsigned i = 0; i < jets_h->size(); ++i) allJets.push_back (jets_h->refAt(i));
65  std::vector <reco::TrackRef> allTracks;
66  allTracks.reserve (tracks_h->size());
67  for (unsigned i = 0; i < tracks_h->size(); ++i) allTracks.push_back (reco::TrackRef (tracks_h, i));
68  // run algo
69  mAssociator.produce (&*jetTracks, allJets, allTracks, classifier);
70  // store output
71  fEvent.put (jetTracks);
72 }
73 
75 
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
int i
Definition: DBlmapReader.cc:9
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void produce(edm::Event &, const edm::EventSetup &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
Get track history and classify it in function of their .
void produce(reco::JetTracksAssociation::Container *fAssociation, const std::vector< edm::RefToBase< reco::Jet > > &fJets, const std::vector< reco::TrackRef > &fTracks, TrackClassifier &classifier) const
JetVetoedTracksAssociationDRVertex mAssociator
JetVetoedTracksAssociatorAtVertex(const edm::ParameterSet &)