58 JetVertexAssociation::JetVertexAssociation(
const edm::ParameterSet& iConfig): m_algo(iConfig),
65 produces<ResultCollection1>(
"Var");
66 produces<ResultCollection2>(
"JetType");
82 double SIGNAL_V_Z = 0.;
83 double SIGNAL_V_Z_ERROR = 0.;
86 VertexCollection::const_iterator vert = vertexes->begin ();
87 if(vertexes->size() > 0 ) {
88 for (; vert != vertexes->end (); vert++) {
90 SIGNAL_V_Z = vert->z();
93 for (; tr != vert->tracks_end(); tr++) pt += (*tr)->pt();
97 SIGNAL_V_Z = vert->z();
98 SIGNAL_V_Z_ERROR = vert->zError();
105 pair<double, bool>
result;
109 CaloJetCollection::const_iterator
jet = jets->begin ();
111 if(jets->size() > 0 ) {
112 for (; jet != jets->end (); jet++) {
113 result =
m_algo.
Main(*jet, tracks, SIGNAL_V_Z, SIGNAL_V_Z_ERROR);
114 result1->push_back(result.first);
115 result2->push_back(result.second);
120 iEvent.
put(result1,
"Var");
121 iEvent.
put(result2,
"JetType");
std::pair< double, bool > Main(const reco::CaloJet &jet, edm::Handle< reco::TrackCollection > tracks, double SIGNAL_V_Z, double SIGNAL_V_Z_Error)
edm::EDGetTokenT< reco::VertexCollection > vertex_token
void produce(edm::Event &e, const edm::EventSetup &c)
edm::EDGetTokenT< reco::TrackCollection > track_token
std::vector< double > ResultCollection1
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< Track > TrackCollection
collection of Tracks
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::EDGetTokenT< reco::CaloJetCollection > jet_token
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< bool > ResultCollection2
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects