#include <JetVertexAssociation.h>
Public Member Functions | |
JetVertexAssociation (const edm::ParameterSet &ps) | |
void | produce (edm::Event &e, const edm::EventSetup &c) |
~JetVertexAssociation () | |
Private Types | |
typedef std::vector< double > | ResultCollection1 |
typedef std::vector< bool > | ResultCollection2 |
Private Attributes | |
std::string | jet_algo |
JetVertexMain | m_algo |
std::string | track_algo |
std::string | vertex_algo |
Definition at line 25 of file JetVertexAssociation.h.
typedef std::vector<double> cms::JetVertexAssociation::ResultCollection1 [private] |
Definition at line 36 of file JetVertexAssociation.h.
typedef std::vector<bool> cms::JetVertexAssociation::ResultCollection2 [private] |
Definition at line 37 of file JetVertexAssociation.h.
JetVertexAssociation::JetVertexAssociation | ( | const edm::ParameterSet & | ps | ) |
Definition at line 63 of file JetVertexAssociation.cc.
: m_algo(iConfig), jet_algo(iConfig.getParameter<std::string>("JET_ALGO")), track_algo(iConfig.getParameter<std::string>("TRACK_ALGO")), vertex_algo(iConfig.getParameter<std::string>("VERTEX_ALGO")) { produces<ResultCollection1>("Var"); produces<ResultCollection2>("JetType"); }
cms::JetVertexAssociation::~JetVertexAssociation | ( | ) | [inline] |
Definition at line 31 of file JetVertexAssociation.h.
{}
void JetVertexAssociation::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 76 of file JetVertexAssociation.cc.
References edm::Event::getByLabel(), metsig::jet, jet_algo, analyzePatCleaning_cfg::jets, m_algo, JetVertexMain::Main(), edm::Event::put(), query::result, track_algo, testEve_cfg::tracks, and vertex_algo.
{ edm::Handle<CaloJetCollection> jets; iEvent.getByLabel(jet_algo, jets); edm::Handle<TrackCollection> tracks; iEvent.getByLabel(track_algo, tracks); edm::Handle<VertexCollection> vertexes; iEvent.getByLabel(vertex_algo, vertexes); double SIGNAL_V_Z = 0.; double SIGNAL_V_Z_ERROR = 0.; double ptmax = -100.; VertexCollection::const_iterator vert = vertexes->begin (); if(vertexes->size() > 0 ) { for (; vert != vertexes->end (); vert++) { SIGNAL_V_Z = vert->z(); double pt = 0.; reco::Vertex::trackRef_iterator tr = vert->tracks_begin(); for (; tr != vert->tracks_end(); tr++) pt += (*tr)->pt(); if( pt >= ptmax ){ ptmax = pt; SIGNAL_V_Z = vert->z(); SIGNAL_V_Z_ERROR = vert->zError(); } } } pair<double, bool> result; std::auto_ptr<ResultCollection1> result1 (new ResultCollection1) ; std::auto_ptr<ResultCollection2> result2 (new ResultCollection2) ; CaloJetCollection::const_iterator jet = jets->begin (); if(jets->size() > 0 ) { for (; jet != jets->end (); jet++) { result = m_algo.Main(*jet, tracks, SIGNAL_V_Z, SIGNAL_V_Z_ERROR); result1->push_back(result.first); result2->push_back(result.second); } } iEvent.put(result1, "Var"); iEvent.put(result2, "JetType"); }
std::string cms::JetVertexAssociation::jet_algo [private] |
Definition at line 40 of file JetVertexAssociation.h.
Referenced by produce().
Definition at line 39 of file JetVertexAssociation.h.
Referenced by produce().
std::string cms::JetVertexAssociation::track_algo [private] |
Definition at line 41 of file JetVertexAssociation.h.
Referenced by produce().
std::string cms::JetVertexAssociation::vertex_algo [private] |
Definition at line 42 of file JetVertexAssociation.h.
Referenced by produce().