21 useQuality(conf.getParameter<bool>(
"useSiStripQuality")),
22 maskBad128StripBlocks( conf.existsAs<bool>(
"MaskBadAPVFibers") && conf.getParameter<bool>(
"MaskBadAPVFibers")),
26 cpeTag(conf.getParameter<edm::
ESInputTag>(
"StripCPE")),
27 matcherTag(conf.getParameter<edm::
ESInputTag>(
"Matcher")),
28 qualityTag(conf.getParameter<edm::
ESInputTag>(
"siStripQualityLabel"))
78 DS = inputhandle->begin(); DS != dse; ++DS ) {
91 cluster = (*DS).begin(); cluster != cle; ++cluster ) {
93 if(
isMasked(*cluster,bad128StripBlocks))
continue;
101 match(output,trackdirection);
107 struct CollectorHelper {
114 Collector & m_collector;
115 CollectorMatched & m_collectorMatched;
117 std::vector<SiStripRecHit2D::ClusterRef::key_type> & m_matchedSteroClusters;
128 Add(CollectorHelper& ih) :
h(ih){}
133 CollectorHelper & collector() {
141 Collector & i_collector,
142 CollectorMatched & i_collectorMatched,
144 std::vector<SiStripRecHit2D::ClusterRef::key_type> & i_matchedSteroClusters
146 m_collector(i_collector),
147 m_collectorMatched(i_collectorMatched),
148 m_fillerRphiUnm(i_fillerRphiUnm),
149 m_matchedSteroClusters(i_matchedSteroClusters) {}
152 if (!m_collectorMatched.empty()){
153 nmatch+=m_collectorMatched.size();
155 edm = m_collectorMatched.end();
158 m_collector.push_back(*itm);
160 m_matchedSteroClusters.push_back(itm->stereoClusterRef().key());
162 m_collectorMatched.clear();
165 m_fillerRphiUnm.push_back(*it);
183 std::vector<SiStripRecHit2D::ClusterRef::key_type> matchedSteroClusters;
191 if (partnerId == 0) {
193 if (!rphiHits.
empty()) {
204 if (itStereoDet == edStereoDet) {
206 if (!rphiHits.
empty()) {
220 Collector collector(*output.
matched, specDetId.glued());
226 matchedSteroClusters.clear();
229 CollectorHelper chelper(collector, collectorMatched,
234 stereoHits.
begin(),stereoHits.
end(),gluedDet,trackdirection,chelper);
235 nmatch+=chelper.nmatch;
240 stereoSimpleHits.reserve(stereoHits.
size());
242 stereoSimpleHits.push_back(&*it);
246 matcher->match(&(*it),stereoSimpleHits.begin(),stereoSimpleHits.end(),collectorMatched,gluedDet,trackdirection);
247 if (collectorMatched.
size()>0){
248 nmatch+=collectorMatched.
size();
250 edm = collectorMatched.
end();
253 collector.push_back(*itm);
255 matchedSteroClusters.push_back(itm->stereoClusterRef().key());
257 collectorMatched.
clear();
260 fillerRphiUnm.push_back(*it);
268 if (collector.empty()) collector.abort();
271 if (fillerRphiUnm.empty()) fillerRphiUnm.abort();
275 std::sort(matchedSteroClusters.begin(), matchedSteroClusters.end());
277 if (!std::binary_search(matchedSteroClusters.begin(), matchedSteroClusters.end(), it->cluster().key())) {
278 fillerStereoUnm.push_back(*it);
281 if (fillerStereoUnm.empty()) fillerStereoUnm.abort();
290 if (partnerId == 0)
continue;
292 if (itRPhiDet == edRPhiDet) {
293 if (!stereoHits.
empty()) {
304 <<
" matched RecHits\n";
311 short badApvs =
quality->getBadApvs(detid);
312 short badFibers =
quality->getBadFibers(detid);
313 for (
int j = 0;
j < 6;
j++) {
314 bad128StripBlocks[
j] = (badApvs & (1 <<
j));
316 for (
int j = 0;
j < 3;
j++) {
317 if (badFibers & (1 <<
j)) {
318 bad128StripBlocks[2*
j+0] =
true;
319 bad128StripBlocks[2*
j+1] =
true;
330 if ( bad128StripBlocks[cluster.
firstStrip() >> 7] ) {
332 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter()-0.499999) >> 7] ) {
337 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter()-0.499999) >> 7] ) {
350 if(stripdet==0)
edm::LogWarning(
"SiStripRecHitConverter") <<
"Detid=" <<
id <<
" not found";
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
void push_back(data_type const &d)
void initialize(const edm::EventSetup &)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Local3DVector LocalVector
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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