18 useQuality(conf.getParameter<bool>(
"useSiStripQuality")),
19 maskBad128StripBlocks( conf.existsAs<bool>(
"MaskBadAPVFibers") && conf.getParameter<bool>(
"MaskBadAPVFibers")),
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();
142 m_matchedSteroClusters.push_back(itm->stereoClusterRef().key());
144 m_collectorMatched.clear();
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";
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)
std::unique_ptr< SiStripMatchedRecHit2DCollection > matched
void initialize(const edm::EventSetup &)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
short getBadFibers(const uint32_t &detid) const
Local3DVector LocalVector
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void run(edm::Handle< edmNew::DetSetVector< SiStripCluster > > input, products &output)
uint32_t quality_cache_id
edm::ESHandle< SiStripRecHitMatcher > matcher
edm::ESHandle< TrackerGeometry > tracker
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters <p) const
std::unique_ptr< SiStripRecHit2DCollection > rphi
uint32_t tracker_cache_id
std::pair< LocalPoint, LocalError > LocalValues
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
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::unique_ptr< SiStripRecHit2DCollection > stereo
short getBadApvs(const uint32_t &detid) const
bool IsModuleUsable(const uint32_t &detid) const
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
bool useModule(const uint32_t id) const
edm::ESInputTag matcherTag
void match(products &output, LocalVector trackdirection) const
void doubleMatch(MonoIterator monoRHiter, MonoIterator monoRHend, StereoIterator seconditer, StereoIterator seconditerend, const GluedGeomDet *gluedDet, LocalVector trdir, CollectorHelper &collectorHelper) const
#define TYPELOOKUP_DATA_REG(_dataclass_)
unsigned int stereo() const
stereo
std::vector< const SiStripRecHit2D * > SimpleHitCollection
std::unique_ptr< SiStripRecHit2DCollection > stereoUnmatched
SiStripRecHit2DCollection::FastFiller Collector
const TrackerGeomDet * idToDet(DetId) const override
edm::ESHandle< StripClusterParameterEstimator > parameterestimator
bool maskBad128StripBlocks
std::unique_ptr< SiStripRecHit2DCollection > rphiUnmatched
const std::vector< uint8_t > & amplitudes() const
edm::ESInputTag qualityTag
bool isMasked(const SiStripCluster &cluster, bool bad128StripBlocks[6]) const
edm::ESHandle< SiStripQuality > quality