10 RPCdigisimlinkTag(conf.getParameter<edm::
InputTag>(
"RPCdigisimlinkTag")),
12 crossingframe(conf.getParameter<bool>(
"crossingframe")),
13 RPCsimhitsTag(conf.getParameter<edm::
InputTag>(
"RPCsimhitsTag")),
14 RPCsimhitsXFTag(conf.getParameter<edm::
InputTag>(
"RPCsimhitsXFTag"))
26 RPCdigisimlinkTag(conf.getParameter<edm::
InputTag>(
"RPCdigisimlinkTag")),
28 crossingframe(conf.getParameter<bool>(
"crossingframe")),
29 RPCsimhitsTag(conf.getParameter<edm::
InputTag>(
"RPCsimhitsTag")),
30 RPCsimhitsXFTag(conf.getParameter<edm::
InputTag>(
"RPCsimhitsXFTag"))
46 std::unique_ptr<MixCollection<PSimHit> >
48 LogTrace(
"RPCHitAssociator") <<
"... size = "<<RPCsimhits->size();
53 hitItr != RPCsimhits->end(); ++hitItr)
55 _SimHitMap[hitItr->detUnitId()].push_back(*hitItr);
62 LogTrace(
"RPCHitAssociator") <<
"... size = "<<RPCsimhits->size();
65 for(edm::PSimHitContainer::const_iterator hitItr = RPCsimhits->begin();
66 hitItr != RPCsimhits->end(); ++hitItr)
68 _SimHitMap[hitItr->detUnitId()].push_back(*hitItr);
81 std::vector<SimHitIdpr> matched;
91 int bx = rpcrechit->
BunchX();
93 for(
int i = fstrip;
i < fstrip+cls; ++
i) {
97 <<
"*** WARNING in RPCHitAssociator::associateRecHit, RPCRecHit "<<*rpcrechit<<
", strip "<<
i<<
" has no associated RPCDigiSimLink !"<<endl;
99 for(std::set<RPCDigiSimLink>::iterator itlink = links.begin(); itlink != links.end(); ++itlink) {
100 SimHitIdpr currentId(itlink->getTrackId(),itlink->getEventId());
101 if(
find(matched.begin(),matched.end(),currentId ) == matched.end())
102 matched.push_back(currentId);
106 }
else edm::LogWarning(
"RPCHitAssociator")<<
"*** WARNING in RPCHitAssociator::associateRecHit, null dynamic_cast !";
113 std::set<RPCDigiSimLink>
links;
118 uint32_t detid = digi_iter->getDetUnitId();
119 int str = digi_iter->getStrip();
120 int bunchx = digi_iter->getBx();
122 if(detid == rpcDetId && str == strip && bunchx == bx){
123 links.insert(*digi_iter);
int firstClusterStrip() const
RPCHitAssociator(const edm::ParameterSet &, edm::ConsumesCollector &&ic)
edm::InputTag RPCdigisimlinkTag
edm::EDGetTokenT< CrossingFrame< PSimHit > > RPCsimhitsXFToken_
void initEvent(const edm::Event &, const edm::EventSetup &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
uint32_t rawId() const
get the raw id
std::vector< SimHitIdpr > associateRecHit(const TrackingRecHit &hit) const
RPCDetId rpcId() const
Return the rpcId.
std::map< unsigned int, edm::PSimHitContainer > _SimHitMap
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
iterator end()
Return the off-the-end iterator.
edm::InputTag RPCsimhitsTag
T const * product() const
edm::EDGetTokenT< edm::PSimHitContainer > RPCsimhitsToken_
edm::InputTag RPCsimhitsXFTag
std::pair< uint32_t, EncodedEventId > SimHitIdpr
std::set< RPCDigiSimLink > findRPCDigiSimLink(uint32_t rpcDetId, int strip, int bx) const
std::vector< PSimHit > PSimHitContainer
iterator begin()
Return an iterator to the first DetSet.
edm::EDGetTokenT< edm::DetSetVector< RPCDigiSimLink > > RPCdigisimlinkToken_
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
edm::Handle< edm::DetSetVector< RPCDigiSimLink > > _thelinkDigis