8 RPCdigisimlinkTag(conf.getParameter<edm::InputTag>(
"RPCdigisimlinkTag")),
10 crossingframe(conf.getParameter<bool>(
"crossingframe")),
11 RPCsimhitsTag(conf.getParameter<edm::InputTag>(
"RPCsimhitsTag")),
12 RPCsimhitsXFTag(conf.getParameter<edm::InputTag>(
"RPCsimhitsXFTag"))
21 std::auto_ptr<MixCollection<PSimHit> >
23 LogTrace(
"RPCHitAssociator") <<
"... size = "<<RPCsimhits->size();
28 hitItr != RPCsimhits->end(); ++hitItr)
30 _SimHitMap[hitItr->detUnitId()].push_back(*hitItr);
37 LogTrace(
"RPCHitAssociator") <<
"... size = "<<RPCsimhits->size();
40 for(edm::PSimHitContainer::const_iterator hitItr = RPCsimhits->begin();
41 hitItr != RPCsimhits->end(); ++hitItr)
43 _SimHitMap[hitItr->detUnitId()].push_back(*hitItr);
56 std::vector<SimHitIdpr> matched;
66 int bx = rpcrechit->
BunchX();
68 for(
int i = fstrip;
i < fstrip+cls; ++
i) {
72 <<
"*** WARNING in RPCHitAssociator::associateRecHit, RPCRecHit "<<*rpcrechit<<
", strip "<<
i<<
" has no associated RPCDigiSimLink !"<<endl;
74 for(std::set<RPCDigiSimLink>::iterator itlink = links.begin(); itlink != links.end(); ++itlink) {
75 SimHitIdpr currentId(itlink->getTrackId(),itlink->getEventId());
76 if(
find(matched.begin(),matched.end(),currentId ) == matched.end())
77 matched.push_back(currentId);
81 }
else edm::LogWarning(
"RPCHitAssociator")<<
"*** WARNING in RPCHitAssociator::associateRecHit, null dynamic_cast !";
88 std::set<RPCDigiSimLink>
links;
93 uint32_t
detid = digi_iter->getDetUnitId();
94 int str = digi_iter->getStrip();
95 int bunchx = digi_iter->getBx();
97 if(detid == rpcDetId && str == strip && bunchx == bx){
98 links.insert(*digi_iter);
int firstClusterStrip() const
edm::InputTag RPCdigisimlinkTag
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::set< RPCDigiSimLink > findRPCDigiSimLink(uint32_t rpcDetId, int strip, int bx)
uint32_t rawId() const
get the raw id
RPCHitAssociator(const edm::Event &, const edm::EventSetup &, const edm::ParameterSet &)
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
edm::InputTag RPCsimhitsXFTag
T const * product() const
std::pair< uint32_t, EncodedEventId > SimHitIdpr
iterator begin()
Return an iterator to the first DetSet.
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
std::vector< SimHitIdpr > associateRecHit(const TrackingRecHit &hit)
edm::Handle< edm::DetSetVector< RPCDigiSimLink > > _thelinkDigis