63 getTokenTTStubDetSetVec_ = consumes<TTStubDetSetVec>(iConfig.
getParameter<
InputTag>(
"InputTagTTStubDetSetVec"));
64 getTokenTTClusterAssMap_ = consumes<TTClusterAssMap>(iConfig.
getParameter<
InputTag>(
"InputTagTTClusterAssMap"));
65 putTokenReconstructable_ = produces<StubAssociation>(iConfig.
getParameter<
string>(
"BranchReconstructable"));
66 putTokenSelection_ = produces<StubAssociation>(iConfig.
getParameter<
string>(
"BranchSelection"));
68 esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
71 void StubAssociator::beginRun(
const Run& iRun,
const EventSetup& iSetup) {
72 setup_ = &iSetup.
getData(esGetTokenSetup_);
82 map<TPPtr, vector<TTStubRef>> mapTPPtrsTTStubRefs;
83 auto isNonnull = [](
const TPPtr& tpPtr) {
return tpPtr.isNonnull(); };
85 ttModule != handleTTStubDetSetVec->
end();
90 for (
unsigned int iClus = 0; iClus < 2; iClus++) {
91 const vector<TPPtr>& assocPtrs =
92 handleTTClusterAssMap->findTrackingParticlePtrs(ttStubRef->clusterRef(iClus));
93 copy_if(assocPtrs.begin(), assocPtrs.end(), inserter(tpPtrs, tpPtrs.begin()), isNonnull);
95 for (
const TPPtr& tpPtr : tpPtrs)
96 mapTPPtrsTTStubRefs[tpPtr].push_back(ttStubRef);
102 for (
const auto&
p : mapTPPtrsTTStubRefs) {
103 if (!setup_->useForReconstructable(*
p.first) || !setup_->reconstructable(
p.second))
105 reconstructable.
insert(
p.first,
p.second);
106 if (setup_->useForAlgEff(*
p.first))
T getParameter(std::string const &) const
EDPutTokenT< StubAssociation > putTokenReconstructable_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Class to process and provide run-time constants used by Track Trigger emulators.
data_type const * const_iterator
Class to associate reconstrucable TrackingParticles with TTStubs and vice versa. It may associate mul...
const_iterator end(bool update=false) const
Stores association of Truth Particles (TP) to L1 Track-Trigger Clusters.
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, det_id_type iDetID, typename HandleT::element_type::value_type::const_iterator itIter)
Class to associate reconstrucable TrackingParticles with TTStubs and vice versa It may associate mult...
#define DEFINE_FWK_MODULE(type)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator begin(bool update=false) const
void insert(const TPPtr &tpPtr, const std::vector< TTStubRef > &ttSTubRefs)
EDGetTokenT< TTStubDetSetVec > getTokenTTStubDetSetVec_
EDGetTokenT< TTClusterAssMap > getTokenTTClusterAssMap_
~StubAssociator() override
EDPutTokenT< StubAssociation > putTokenSelection_