88 : outputCollectionNames_(iConfig.getParameter<
std::
vector<
std::
string>>(
"outputCollectionNames")),
98 produces<TrackingParticleCollection>();
112 auto vTrackingParticles = std::make_unique<TrackingParticleCollection>();
126 unsigned int nTP = tpHandle->size();
127 auto vTPs = std::make_unique<std::vector<l1tVertexFinder::TP>>();
128 auto vTPsUse = std::make_unique<std::vector<l1tVertexFinder::TP>>();
130 vTPsUse->reserve(nTP);
131 std::set<edm::Ptr<TrackingParticle>> sTPs;
132 for (
unsigned int i = 0;
i < nTP;
i++) {
139 vTrackingParticles->push_back(tpHandle->at(
i));
140 vTPsUse->push_back(
tp);
146 auto vAllMatchedTPs = std::make_unique<std::vector<l1tVertexFinder::TP>>(*vTPsUse);
147 for (
auto&
entry : mcTruthTTTrackHandle->getTTTrackToTrackingParticleMap()) {
148 if (sTPs.count(
entry.second) == 0) {
161 unsigned int nStubs = ttStubHandle->
size();
162 auto vAllStubs = std::make_unique<std::vector<l1tVertexFinder::Stub>>();
163 vAllStubs->reserve(nStubs);
170 stub.
fillTruth(mcTruthTTStubHandle, mcTruthTTClusterHandle);
171 vAllStubs->push_back(stub);
176 std::map<const TrackingParticlePtr, std::vector<l1tVertexFinder::Stub>> tpStubMap;
178 tpStubMap[
tp.getTrackingParticle()] = std::vector<l1tVertexFinder::Stub>();
181 tpStubMap[
tp].push_back(stub);
185 assert(tpStubMap.count(
tp.getTrackingParticle()) == 1);
186 tp.setMatchingStubs(tpStubMap.find(
tp.getTrackingParticle())->
second);
193 auto vTrackingParticlesHandle =
iEvent.put(
std::move(vTrackingParticles));
197 auto TPV = std::make_unique<edm::ValueMap<l1tVertexFinder::TP>>();
199 fillerTP.insert(tpHandle, vTPs->begin(), vTPs->end());
203 auto TPuseV = std::make_unique<edm::ValueMap<l1tVertexFinder::TP>>();
205 fillerTPuse.insert(vTrackingParticlesHandle, vTPsUse->begin(), vTPsUse->end());
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
TPStubValueMapProducer(const edm::ParameterSet &)
TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > TTTrackAssMap
edm::Ref< DetSetVec, TTStub< Ref_Phase2TrackerDigi_ > > TTStubRef
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::EDGetTokenT< TTStubAssMap > stubTruthToken_
void fillTruth(edm::Handle< TTStubAssMap > mcTruthTTStubHandle, edm::Handle< TTClusterAssMap > mcTruthTTClusterHandle)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
data_type const * const_iterator
edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > l1TracksMapToken_
const edm::EDGetTokenT< TrackingParticleCollection > tpToken_
const_iterator end(bool update=false) const
Stores association of Truth Particles (TP) to L1 Track-Trigger Clusters.
Stores association of Truth Particles (TP) to L1 Track-Trigger Tracks.
l1tVertexFinder::AnalysisSettings settings_
U second(std::pair< T, U > const &p)
void addDefault(ParameterSetDescription const &psetDescription)
TTClusterAssociationMap< Ref_Phase2TrackerDigi_ > TTClusterAssMap
~TPStubValueMapProducer() override
#define DEFINE_FWK_MODULE(type)
edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > > DetSetVec
edm::Ptr< TrackingParticle > TrackingParticlePtr
const edm::EDGetTokenT< DetSetVec > stubToken_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin(bool update=false) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
edmNew::DetSet< TTStub< Ref_Phase2TrackerDigi_ > > DetSet
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
TTStubAssociationMap< Ref_Phase2TrackerDigi_ > TTStubAssMap
const std::vector< std::string > outputCollectionNames_
std::vector< TrackingParticle > TrackingParticleCollection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Stores association of Truth Particles (TP) to L1 Track-Trigger Stubs.
const edm::EDGetTokenT< TTClusterAssMap > clusterTruthToken_