18 useQuality(conf.getParameter<bool>(
"useSiStripQuality")),
19 maskBad128StripBlocks( conf.existsAs<bool>(
"MaskBadAPVFibers") && conf.getParameter<bool>(
"MaskBadAPVFibers")),
23 cpeTag(conf.getParameter<edm::
ESInputTag>(
"StripCPE")),
24 matcherTag(conf.getParameter<edm::
ESInputTag>(
"Matcher")),
25 qualityTag(conf.getParameter<edm::
ESInputTag>(
"siStripQualityLabel"))
60 for (
auto const & DS : *inputhandle) {
71 for(
auto const & cluster : DS) {
73 if(
isMasked(cluster,bad128StripBlocks))
continue;
77 DS.makeRefTo(inputhandle, &cluster)
83 match(output,trackdirection);
89 struct CollectorHelper {
96 Collector & m_collector;
97 CollectorMatched & m_collectorMatched;
99 std::vector<SiStripRecHit2D::ClusterRef::key_type> & m_matchedSteroClusters;
110 Add(CollectorHelper& ih) :
h(ih){}
115 CollectorHelper & collector() {
123 Collector & i_collector,
124 CollectorMatched & i_collectorMatched,
126 std::vector<SiStripRecHit2D::ClusterRef::key_type> & i_matchedSteroClusters
128 m_collector(i_collector),
129 m_collectorMatched(i_collectorMatched),
130 m_fillerRphiUnm(i_fillerRphiUnm),
131 m_matchedSteroClusters(i_matchedSteroClusters) {}
134 if (!m_collectorMatched.empty()){
135 nmatch+=m_collectorMatched.size();
137 edm = m_collectorMatched.end();
140 m_collector.push_back(*itm);
142 m_matchedSteroClusters.push_back(itm->stereoClusterRef().key());
144 m_collectorMatched.clear();
147 m_fillerRphiUnm.push_back(*it);
165 std::vector<SiStripRecHit2D::ClusterRef::key_type> matchedSteroClusters;
173 if (partnerId == 0) {
175 if (!rphiHits.
empty()) {
186 if (itStereoDet == edStereoDet) {
188 if (!rphiHits.
empty()) {
202 Collector collector(*output.
matched, specDetId.glued());
208 matchedSteroClusters.clear();
211 CollectorHelper chelper(collector, collectorMatched,
216 stereoHits.
begin(),stereoHits.
end(),gluedDet,trackdirection,chelper);
217 nmatch+=chelper.nmatch;
222 stereoSimpleHits.reserve(stereoHits.
size());
224 stereoSimpleHits.push_back(&*it);
228 matcher->match(&(*it),stereoSimpleHits.begin(),stereoSimpleHits.end(),collectorMatched,gluedDet,trackdirection);
229 if (collectorMatched.
size()>0){
230 nmatch+=collectorMatched.
size();
232 edm = collectorMatched.
end();
235 collector.push_back(*itm);
237 matchedSteroClusters.push_back(itm->stereoClusterRef().key());
239 collectorMatched.
clear();
242 fillerRphiUnm.push_back(*it);
250 if (collector.empty()) collector.abort();
253 if (fillerRphiUnm.empty()) fillerRphiUnm.abort();
257 std::sort(matchedSteroClusters.begin(), matchedSteroClusters.end());
259 if (!std::binary_search(matchedSteroClusters.begin(), matchedSteroClusters.end(), it->cluster().key())) {
263 if (fillerStereoUnm.empty()) fillerStereoUnm.abort();
272 if (partnerId == 0)
continue;
274 if (itRPhiDet == edRPhiDet) {
275 if (!stereoHits.
empty()) {
286 <<
" matched RecHits\n";
293 short badApvs =
quality->getBadApvs(detid);
294 short badFibers =
quality->getBadFibers(detid);
295 for (
int j = 0;
j < 6;
j++) {
296 bad128StripBlocks[
j] = (badApvs & (1 <<
j));
298 for (
int j = 0;
j < 3;
j++) {
299 if (badFibers & (1 <<
j)) {
300 bad128StripBlocks[2*
j+0] =
true;
301 bad128StripBlocks[2*
j+1] =
true;
312 if ( bad128StripBlocks[cluster.
firstStrip() >> 7] ) {
314 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter()-0.499999) >> 7] ) {
319 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter()-0.499999) >> 7] ) {
332 if(stripdet==0)
edm::LogWarning(
"SiStripRecHitConverter") <<
"Detid=" <<
id <<
" not found";
void push_back(data_type const &d)
void initialize(const edm::EventSetup &)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Local3DVector LocalVector
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void run(edm::Handle< edmNew::DetSetVector< SiStripCluster > > input, products &output)
std::auto_ptr< SiStripRecHit2DCollection > rphiUnmatched
uint32_t quality_cache_id
edm::ESHandle< SiStripRecHitMatcher > matcher
edm::ESHandle< TrackerGeometry > tracker
uint32_t tracker_cache_id
uint16_t firstStrip() const
data_type const * const_iterator
SiStripRecHitConverterAlgorithm(const edm::ParameterSet &)
void fillBad128StripBlocks(const uint32_t detid, bool bad128StripBlocks[6]) const
unsigned int partnerDetId() const
static std::string const input
bool useModule(const uint32_t id) const
edm::ESInputTag matcherTag
void match(products &output, LocalVector trackdirection) const
std::auto_ptr< SiStripRecHit2DCollection > stereoUnmatched
std::auto_ptr< SiStripRecHit2DCollection > rphi
#define TYPELOOKUP_DATA_REG(_dataclass_)
unsigned int stereo() const
stereo
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollection::FastFiller Collector
std::pair< LocalPoint, LocalError > LocalValues
edm::ESHandle< StripClusterParameterEstimator > parameterestimator
bool maskBad128StripBlocks
std::auto_ptr< SiStripMatchedRecHit2DCollection > matched
const std::vector< uint8_t > & amplitudes() const
std::auto_ptr< SiStripRecHit2DCollection > stereo
edm::ESInputTag qualityTag
bool isMasked(const SiStripCluster &cluster, bool bad128StripBlocks[6]) const
edm::ESHandle< SiStripQuality > quality