10 signalTracksTag(conf.getParameter<
edm::InputTag>(
"signalTracks")),
11 pileUpTracksTag(conf.getParameter<
edm::InputTag>(
"pileUpTracks")),
62 e.getByLabel(label, tracks);
63 e.getByLabel(label, hits);
64 e.getByLabel(label, trackExtras);
68 throw cms::Exception (
"RecoTrackAccumulator") <<
"Failed to find track collections with inputTag " << label << std::endl;
72 throw cms::Exception (
"RecoTrackAccumulator") <<
"Failed to find hit collections with inputTag " << label << std::endl;
76 throw cms::Exception (
"RecoTrackAccumulator") <<
"Failed to find trackExtra collections with inputTag " << label << std::endl;
79 for (
size_t t = 0;
t < tracks->size();++
t){
83 auto const& extra = trackExtras->at(track.
extra().
key());
84 newTrackExtras_->emplace_back(extra.outerPosition(), extra.outerMomentum(), extra.outerOk(),
85 extra.innerPosition(),extra.innerMomentum(), extra.innerOk(),
86 extra.outerStateCovariance(), extra.outerDetId(),
87 extra.innerStateCovariance(), extra.innerDetId(),
88 extra.seedDirection(),
99 auto const firstTrackIndex =
newHits_->size();
100 for(
unsigned int i = 0;
i<extra.recHitsSize();
i++){
101 newHits_->push_back( (*hits)[extra.recHit(
i).key()] );
103 newExtra.setHits(
rNewHits, firstTrackIndex,
newHits_->size() - firstTrackIndex);
104 newExtra.setTrajParams(extra.trajParams(),extra.chi2sX5());
105 assert(newExtra.recHitsSize()==newExtra.trajParams().size());
int bunchCrossing() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void accumulateEvent(const T &e, edm::EventSetup const &c, const edm::InputTag &label)
const TrackExtraRef & extra() const
reference to "extra" object
std::vector< Track > TrackCollection
collection of Tracks
void initializeEvent(edm::Event const &e, edm::EventSetup const &c) override
key_type key() const
Accessor for product key.
void accumulate(edm::Event const &e, edm::EventSetup const &c) override
std::unique_ptr< reco::TrackCollection > newTracks_
TrackingRecHitRefProd rNewHits
std::unique_ptr< reco::TrackExtraCollection > newTrackExtras_
reco::TrackRefProd rNewTracks
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
std::unique_ptr< TrackingRecHitCollection > newHits_
void finalizeEvent(edm::Event &e, edm::EventSetup const &c) override
#define DEFINE_DIGI_ACCUMULATOR(type)
~RecoTrackAccumulator() override
RecoTrackAccumulator(const edm::ParameterSet &conf, edm::stream::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
edm::InputTag signalTracksTag
edm::InputTag pileUpTracksTag
reco::TrackExtraRefProd rNewTrackExtras