CMS 3D CMS Logo

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 //
7 //
8 
14 
21 
23 
25 {
26 public:
29  virtual void produce(edm::Event&, const edm::EventSetup&) override;
30 private:
35 };
36 
38  : mJets (consumes<edm::View<reco::Jet>>(fConfig.getParameter<edm::InputTag> ("jets"))),
39  mTracks (consumes<reco::TrackCollection>(fConfig.getParameter<edm::InputTag> ("tracks"))),
40  mAssociator (fConfig.getParameter<double> ("coneSize")),
41  classifier(fConfig,consumesCollector())
42 {
43  produces<reco::JetTracksAssociation::Container> ();
44 }
45 
47 
49 {
50  // Gather contextual information for TrackCategories
51  classifier.newEvent(fEvent, fSetup);
52 
54  fEvent.getByToken (mJets, jets_h);
56  fEvent.getByToken (mTracks, tracks_h);
57 
58  std::unique_ptr<reco::JetTracksAssociation::Container> jetTracks (new reco::JetTracksAssociation::Container (reco::JetRefBaseProd(jets_h)));
59 
60  // format inputs
61  std::vector <edm::RefToBase<reco::Jet> > allJets;
62  allJets.reserve (jets_h->size());
63  for (unsigned i = 0; i < jets_h->size(); ++i) allJets.push_back (jets_h->refAt(i));
64  std::vector <reco::TrackRef> allTracks;
65  allTracks.reserve (tracks_h->size());
66  for (unsigned i = 0; i < tracks_h->size(); ++i) allTracks.push_back (reco::TrackRef (tracks_h, i));
67  // run algo
68  mAssociator.produce (&*jetTracks, allJets, allTracks, classifier);
69  // store output
70  fEvent.put(std::move(jetTracks));
71 }
72 
74 
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< reco::TrackCollection > mTracks
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual void produce(edm::Event &, const edm::EventSetup &) override
Definition: Jet.py:1
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void newEvent(edm::Event const &, edm::EventSetup const &)
Pre-process event information (for accessing reconstraction information)
Get track history and classify it in function of their .
fixed size matrix
HLT enums.
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
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
def move(src, dest)
Definition: eostools.py:510
JetVetoedTracksAssociatorAtVertex(const edm::ParameterSet &)