89 : outputCollectionNames_(iConfig.getParameter<std::
vector<std::
string>>(
"outputCollectionNames")),
91 l1TracksMapToken_(consumes<
TTTrackAssMap>(iConfig.getParameter<edm::
InputTag>(
"l1TracksTruthMapInputTags"))),
93 stubToken_(consumes<
DetSetVec>(iConfig.getParameter<edm::
InputTag>(
"stubInputTag"))),
94 stubTruthToken_(consumes<
TTStubAssMap>(iConfig.getParameter<edm::
InputTag>(
"stubTruthInputTag"))),
99 produces<TrackingParticleCollection>();
113 auto vTrackingParticles = std::make_unique<TrackingParticleCollection>();
127 unsigned int nTP = tpHandle->size();
128 auto vTPs = std::make_unique<std::vector<l1tVertexFinder::TP>>();
129 auto vTPsUse = std::make_unique<std::vector<l1tVertexFinder::TP>>();
131 vTPsUse->reserve(nTP);
132 std::set<edm::Ptr<TrackingParticle>> sTPs;
133 for (
unsigned int i = 0;
i < nTP;
i++) {
140 vTrackingParticles->push_back(tpHandle->at(
i));
141 vTPsUse->push_back(tp);
147 auto vAllMatchedTPs = std::make_unique<std::vector<l1tVertexFinder::TP>>(*vTPsUse);
148 for (
auto&
entry : mcTruthTTTrackHandle->getTTTrackToTrackingParticleMap()) {
149 if (sTPs.count(
entry.second) == 0) {
162 unsigned int nStubs = ttStubHandle->size();
163 auto vAllStubs = std::make_unique<std::vector<l1tVertexFinder::Stub>>();
164 vAllStubs->reserve(nStubs);
171 stub.
fillTruth(mcTruthTTStubHandle, mcTruthTTClusterHandle);
172 vAllStubs->push_back(stub);
177 std::map<const TrackingParticlePtr, std::vector<l1tVertexFinder::Stub>> tpStubMap;
179 tpStubMap[
tp.getTrackingParticle()] = std::vector<l1tVertexFinder::Stub>();
182 tpStubMap[
tp].push_back(stub);
186 assert(tpStubMap.count(
tp.getTrackingParticle()) == 1);
187 tp.setMatchingStubs(tpStubMap.find(
tp.getTrackingParticle())->
second);
194 auto vTrackingParticlesHandle = iEvent.
put(
std::move(vTrackingParticles));
198 auto TPV = std::make_unique<edm::ValueMap<l1tVertexFinder::TP>>();
200 fillerTP.insert(tpHandle, vTPs->begin(), vTPs->end());
204 auto TPuseV = std::make_unique<edm::ValueMap<l1tVertexFinder::TP>>();
206 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
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< TTStubAssMap > stubTruthToken_
void fillTruth(edm::Handle< TTStubAssMap > mcTruthTTStubHandle, edm::Handle< TTClusterAssMap > mcTruthTTClusterHandle)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
data_type const * const_iterator
edm::EDGetTokenT< TTTrackAssociationMap< Ref_Phase2TrackerDigi_ > > l1TracksMapToken_
const edm::EDGetTokenT< TrackingParticleCollection > tpToken_
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_
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
void addDefault(ParameterSetDescription const &psetDescription)
TTClusterAssociationMap< Ref_Phase2TrackerDigi_ > TTClusterAssMap
~TPStubValueMapProducer() override
edmNew::DetSetVector< TTStub< Ref_Phase2TrackerDigi_ > > DetSetVec
edm::Ptr< TrackingParticle > TrackingParticlePtr
const edm::EDGetTokenT< DetSetVec > stubToken_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
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_