11 for (
auto iTr = tracks.
begin(); iTr != tracks.
end(); ++iTr) {
12 if (&(*iTr) ==
track) {
13 return iTr - tracks.
begin();
26 std::vector<OnTrackCluster>
clusters{};
28 for (
const auto& assoc : *trajTrackAssociations) {
29 const auto traj = assoc.key.get();
30 const auto track = assoc.val.get();
32 for (
const auto& meas : traj->measurements()) {
33 const auto& trajState = meas.updatedState();
34 if (!trajState.isValid())
38 const auto trechit = meas.
recHit()->hit();
43 clusters.emplace_back(matched->monoId(), &matched->monoCluster(), traj,
track, meas);
44 clusters.emplace_back(matched->stereoId(), &matched->stereoCluster(), traj,
track, meas);
46 clusters.emplace_back(simple->geographicalId().rawId(), simple->cluster().get(), traj,
track, meas);
47 }
else if (simple1d) {
48 clusters.emplace_back(simple1d->geographicalId().rawId(), simple1d->cluster().get(), traj,
track, meas);
55 std::vector<int> c_trackindex;
56 c_trackindex.reserve(
clusters.size());
57 std::vector<uint32_t> c_rawid;
61 c_rawid.push_back(clus.det);
63 addColumn(
out.get(),
"trackindex", c_trackindex,
"Track index");
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
auto const & tracks
cannot be loose
const_iterator begin() const
const edm::EDGetTokenT< TrajTrackAssociationCollection > m_association_token
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) final
static void addColumn(nanoaod::FlatTable *table, const std::string &name, VALUES &&values, const std::string &doc)
TrackingRecHitRef recHit(size_t i) const
Get i-th hit on the track.
const edm::EDGetTokenT< edm::View< reco::Track > > m_tracks_token
const_iterator end() const
virtual void fillTable(const std::vector< OnTrackCluster > &clusters, const edm::View< reco::Track > &tracks, nanoaod::FlatTable *table, const edm::EventSetup &iSetup)=0
~SiStripOnTrackClusterTableProducerBase() override