#include <string>
#include <vector>
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Common/interface/View.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
: input_(config.getParameter<
edm::InputTag>(
"input")),
branch_(config.getParameter<
std::string>(
"branch")) {
consumes<edm::View<reco::Track>>(input_);
tracks_ = new std::vector<ic::Track>();
}
void ICTrackProducer::produce(edm::Event& event, const edm::EventSetup& setup) {
edm::Handle<edm::View<reco::Track> > track_handle;
event.getByLabel(input_, track_handle);
tracks_->clear();
tracks_->resize(track_handle->size(),
ic::Track());
for (unsigned i = 0; i < track_handle->size(); ++i) {
reco::Track const& src = track_handle->at(i);
dest.
set_id(track_hasher_(&src));
dest.
set_hits(src.hitPattern().numberOfValidHits());
#if CMSSW_MAJOR_VERSION > 7 || (CMSSW_MAJOR_VERSION == 7 && CMSSW_MINOR_VERSION >= 2)
src.hitPattern().numberOfHits(reco::HitPattern::MISSING_INNER_HITS));
#else
#endif
}
}
void ICTrackProducer::beginJob() {
}
void ICTrackProducer::endJob() {}