75 |
|
typedef RPCRecHitCollection::const_iterator IH; |
76 |
|
for (IH ih=recHits->begin(); ih != recHits->end(); ++ih) { |
77 |
|
|
78 |
+ |
if (ih->BunchX() != 0) continue; |
79 |
+ |
if (! ih->isValid() ) continue; |
80 |
|
RPCDetId rpcDet = ih->rpcId(); |
81 |
|
GlobalPoint detPosition = rpcGeometry->idToDet(rpcDet)->position(); |
82 |
|
GlobalPoint hitPosition = rpcGeometry->idToDet(rpcDet)->toGlobal(ih->localPosition()); |
131 |
|
return detsHitsCompatibleWithMuon; |
132 |
|
} |
133 |
|
|
134 |
+ |
std::vector<uint32_t> DetHitCompatibleCollector::clSizeCompDets(const std::vector<uint32_t> & detIds, const edm::Event &ev, const edm::EventSetup &es) |
135 |
+ |
{ |
136 |
+ |
std::vector<uint32_t> cluInDets; |
137 |
+ |
edm::Handle<RPCRecHitCollection> recHits; |
138 |
+ |
ev.getByLabel("rpcRecHits", recHits); |
139 |
+ |
for (std::vector<uint32_t>::const_iterator it = detIds.begin(); it != detIds.end(); ++it) { |
140 |
+ |
RPCRecHitCollection::range range = recHits->get(*it); |
141 |
+ |
// std::cout <<"DET: "<<*it << std::endl; |
142 |
+ |
for(RPCRecHitCollection::const_iterator ih= range.first; ih != range.second; ++ih) { |
143 |
+ |
if (ih->BunchX() == 0) { cluInDets.push_back(ih->clusterSize()); break; } |
144 |
+ |
} |
145 |
+ |
// for(RPCRecHitCollection::const_iterator ih= range.first; ih != range.second; ++ih) |
146 |
+ |
// std::cout <<" Hit: cluster:"<<ih->clusterSize() << "first strip: "<<ih->firstClusterStrip()<<std::endl; |
147 |
+ |
// if (range.second-range.first) cluInDets.push_back(range.first->clusterSize()); |
148 |
+ |
} |
149 |
+ |
return cluInDets; |
150 |
+ |
} |
151 |
+ |
|
152 |
|
std::vector<uint32_t> DetHitCompatibleCollector::nDigisCompDets(const std::vector<uint32_t> & detIds, const edm::Event &ev, const edm::EventSetup &es) |
153 |
|
{ |
154 |
|
std::vector<uint32_t> digisInDets; |
155 |
|
edm::Handle<RPCDigiCollection> rpcDigis; |
156 |
|
ev.getByLabel("muonRPCDigis", rpcDigis); |
137 |
– |
|
157 |
|
for (std::vector<uint32_t>::const_iterator it = detIds.begin(); it != detIds.end(); ++it) { |
158 |
+ |
// std::cout <<"DET: "<<*it << std::endl; |
159 |
|
const RPCDigiCollection::Range range = rpcDigis->get(*it); |
140 |
– |
//unsigned int ndigis = (range.second-range.first); |
160 |
|
std::map<int, bool> strips; |
161 |
+ |
// for (RPCDigiCollection::const_iterator id = range.first; id != range.second; ++id) id->print() ; |
162 |
|
for (RPCDigiCollection::const_iterator id = range.first; id != range.second; ++id) if (id->bx() == 0) strips[id->strip()] = true; |
163 |
+ |
if ( strips.size() == 0 ) std::cout <<"WARNING ***************"<<std::endl; |
164 |
|
digisInDets.push_back( strips.size()); |
165 |
+ |
// std::cout <<"SIZE is : "<<strips.size() << std::endl; |
166 |
|
} |
167 |
|
return digisInDets; |
146 |
– |
|
168 |
|
} |
169 |
+ |
|
170 |
|
std::vector<uint32_t> DetHitCompatibleCollector::compatibleDets( const reco::Muon* muon, const edm::Event &ev, const edm::EventSetup &es, bool deepInside) |
171 |
|
{ |
172 |
|
std::vector<uint32_t> detsCrossedByMuon; |