10 signalTracksTag(conf.getParameter<edm::
InputTag>(
"signalTracks")),
11 signalMVAValuesTag(conf.getParameter<edm::
InputTag>(
"signalMVAValues")),
12 pileUpTracksTag(conf.getParameter<edm::
InputTag>(
"pileUpTracks")),
13 pileUpMVAValuesTag(conf.getParameter<edm::
InputTag>(
"pileUpMVAValues")),
14 outputLabel(conf.getParameter<std::
string>(
"outputLabel")),
15 MVAOutputLabel(conf.getParameter<std::
string>(
"MVAOutputLabel"))
75 if(!(e.getByLabel(label, tracks) and e.getByLabel(label, hits) and e.getByLabel(label, trackExtras))){
76 edm::LogError (
"RecoTrackAccumulator") <<
"Failed to find track, hit or trackExtra collections with inputTag " <<
label;
79 else if(!e.getByLabel(MVALabel,mvaVals)){
80 edm::LogError (
"RecoTrackAccumulator") <<
"Failed to find mva values with inputTag" << MVALabel;
84 if(tracks->size() != mvaVals->size()){
85 edm::LogError(
"RecoTrackAccumulator") <<
"RecoTrackAccumulator expects the track collection and the MVA values to have the same number of entries" << std::endl;
87 if (tracks->size()==0)
94 for (
size_t t = 0;
t < tracks->size();++
t){
98 auto const& extra = trackExtras->at(track.
extra().
key());
99 newTrackExtras_->emplace_back(extra.outerPosition(), extra.outerMomentum(), extra.outerOk(),
100 extra.innerPosition(),extra.innerMomentum(), extra.innerOk(),
101 extra.outerStateCovariance(), extra.outerDetId(),
102 extra.innerStateCovariance(), extra.innerDetId(),
103 extra.seedDirection(),
114 auto const firstTrackIndex =
newHits_->size();
115 for(
unsigned int i = 0;
i<extra.recHitsSize();
i++){
116 newHits_->push_back( (*hits)[extra.recHit(
i).key()] );
118 newExtra.setHits(
rNewHits, firstTrackIndex,
newHits_->size() - firstTrackIndex);
122 float _val = mvaVals->get(tracksProdId,
t);
int bunchCrossing() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const TrackExtraRef & extra() const
reference to "extra" object
edm::InputTag signalMVAValuesTag
void insert(const H &h, I begin, I end)
std::vector< Track > TrackCollection
collection of Tracks
virtual ~RecoTrackAccumulator()
std::string MVAOutputLabel
key_type key() const
Accessor for product key.
RecoTrackAccumulator(const edm::ParameterSet &conf, edm::one::EDProducerBase &mixMod, edm::ConsumesCollector &iC)
virtual void accumulate(edm::Event const &e, edm::EventSetup const &c)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
TrackingRecHitRefProd rNewHits
reco::TrackRefProd rNewTracks
edm::InputTag pileUpMVAValuesTag
void accumulateEvent(const T &e, edm::EventSetup const &c, const edm::InputTag &label, const edm::InputTag &MVALabel)
std::vector< float > newMVAVals_
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
std::auto_ptr< reco::TrackExtraCollection > newTrackExtras_
virtual void finalizeEvent(edm::Event &e, edm::EventSetup const &c)
virtual void initializeEvent(edm::Event const &e, edm::EventSetup const &c)
ProductID id() const
Accessor for product ID.
std::auto_ptr< TrackingRecHitCollection > newHits_
std::auto_ptr< reco::TrackCollection > newTracks_
edm::InputTag signalTracksTag
edm::InputTag pileUpTracksTag
reco::TrackExtraRefProd rNewTrackExtras