4 #include "FWCore/Framework/interface/Event.h"
5 #include "FWCore/Framework/interface/EventSetup.h"
6 #include "FWCore/Framework/interface/MakerMacros.h"
7 #include "FWCore/ParameterSet/interface/ParameterSet.h"
8 #include "FWCore/Utilities/interface/InputTag.h"
9 #include "DataFormats/Common/interface/Handle.h"
10 #include "DataFormats/Common/interface/View.h"
11 #include "DataFormats/TrackReco/interface/Track.h"
12 #include "DataFormats/TrackReco/interface/TrackFwd.h"
20 : input_(config.getParameter<
edm::InputTag>(
"input")),
21 branch_(config.getParameter<
std::string>(
"branch")) {
22 consumes<edm::View<reco::Track>>(input_);
23 tracks_ =
new std::vector<ic::Track>();
29 void ICTrackProducer::produce(edm::Event& event,
const edm::EventSetup& setup) {
30 edm::Handle<edm::View<reco::Track> > track_handle;
31 event.getByLabel(input_, track_handle);
35 tracks_->resize(track_handle->size(),
ic::Track());
37 for (
unsigned i = 0; i < track_handle->size(); ++i) {
38 reco::Track
const& src = track_handle->at(i);
40 dest.
set_id(track_hasher_(&src));
49 dest.
set_hits(src.hitPattern().numberOfValidHits());
54 #if CMSSW_MAJOR_VERSION > 7 || (CMSSW_MAJOR_VERSION == 7 && CMSSW_MINOR_VERSION >= 2)
56 src.hitPattern().numberOfHits(reco::HitPattern::MISSING_INNER_HITS));
63 void ICTrackProducer::beginJob() {
67 void ICTrackProducer::endJob() {}
void set_hits_miss_inner(int const &hits_miss_inner)
hitPattern().numberOfHits(reco::HitPattern::MISSING_INNER_HITS)
void set_quality(int const &quality)
The track quality flags.
void set_phi(double const &phi)
Track azimuthal angle.
void set_hits(int const &hits)
Number of tracker hits.
DEFINE_FWK_MODULE(ICTrackProducer)
void set_vy(double const &y)
The y-coordinate of the PCA.
void set_algorithm(int16_t const &algorithm)
The tracking algorithm used to produce this track See: DataFormats/TrackReco/interface/TrackBase.h.
void set_eta(double const &eta)
Track pseudorapidity.
void set_pt_err(double const &pt_err)
The track error.
void set_charge(int const &charge)
The track charge.
Stores limited information about the track kinematics and trajectory.
ICTrackProducer(const edm::ParameterSet &)
void set_vx(double const &x)
The z-coordinate of the PCA.
void set_vz(double const &z)
The z-coordinate of the PCA.
void set_id(std::size_t const &id)
The unique identifier.
void set_pt(double const &pt)
The track transverse momentum.
void set_normalized_chi2(double const &normalized_chi2)
The normalised chi2 of the track fit.
void set_pixel_hits(int const &pixel_hits)
Number of pixel hits.