8 : RPCdigisimlinkTag(conf.getParameter<edm::
InputTag>(
"RPCdigisimlinkTag")),
12 crossingframe(conf.getParameter<bool>(
"crossingframe")) {
32 LogTrace(
"RPCHitAssociator") <<
"... size = " << RPCsimhits->size();
37 _SimHitMap[hitItr->detUnitId()].push_back(*hitItr);
43 LogTrace(
"RPCHitAssociator") <<
"... size = " << RPCsimhits.size();
46 for (edm::PSimHitContainer::const_iterator hitItr = RPCsimhits.begin(); hitItr != RPCsimhits.end(); ++hitItr) {
47 _SimHitMap[hitItr->detUnitId()].push_back(*hitItr);
57 std::vector<SimHitIdpr> matched;
68 for (
int i = fstrip;
i < fstrip + cls; ++
i) {
72 LogTrace(
"RPCHitAssociator") <<
"*** WARNING in RPCHitAssociator::associateRecHit, RPCRecHit " << *rpcrechit
73 <<
", strip " <<
i <<
" has no associated RPCDigiSimLink !" << endl;
75 for (std::set<RPCDigiSimLink>::iterator itlink = links.begin(); itlink != links.end(); ++itlink) {
76 SimHitIdpr currentId(itlink->getTrackId(), itlink->getEventId());
77 if (
find(matched.begin(), matched.end(), currentId) == matched.end())
78 matched.push_back(currentId);
83 LogTrace(
"RPCHitAssociator") <<
"*** WARNING in RPCHitAssociator::associateRecHit, null "
90 std::set<RPCDigiSimLink>
links;
97 uint32_t detid = digi_iter->getDetUnitId();
98 int str = digi_iter->getStrip();
99 int bunchx = digi_iter->getBx();
101 if (detid == rpcDetId && str == strip && bunchx == bx) {
102 links.insert(*digi_iter);
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int firstClusterStrip() const
edm::InputTag RPCsimhitsXFTag
Config(const edm::ParameterSet &, edm::ConsumesCollector ic)
RPCHitAssociator(const edm::Event &e, const Config &conf)
constexpr uint32_t rawId() const
get the raw id
edm::EDGetTokenT< CrossingFrame< PSimHit > > RPCsimhitsXFToken_
edm::Handle< edm::DetSetVector< RPCDigiSimLink > > _thelinkDigis
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< SimHitIdpr > associateRecHit(const TrackingRecHit &hit) const
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
edm::InputTag RPCsimhitsTag
RPCDetId rpcId() const
Return the rpcId.
void initEvent(const edm::Event &)
std::map< unsigned int, edm::PSimHitContainer > _SimHitMap
bool get(ProductID const &oid, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
std::pair< uint32_t, EncodedEventId > SimHitIdpr
edm::EDGetTokenT< edm::PSimHitContainer > RPCsimhitsToken_
std::set< RPCDigiSimLink > findRPCDigiSimLink(uint32_t rpcDetId, int strip, int bx) const
edm::EDGetTokenT< edm::DetSetVector< RPCDigiSimLink > > RPCdigisimlinkToken_
edm::InputTag RPCdigisimlinkTag
std::vector< PSimHit > PSimHitContainer
iterator begin()
Return an iterator to the first DetSet.
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator