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"))
62 DS = inputhandle->begin(); DS != dse; ++DS ) {
75 cluster = (*DS).begin(); cluster != cle; ++cluster ) {
77 if(
isMasked(*cluster,bad128StripBlocks))
continue;
85 match(output,trackdirection);
91 struct CollectorHelper {
98 Collector & m_collector;
99 CollectorMatched & m_collectorMatched;
101 std::vector<SiStripRecHit2D::ClusterRef::key_type> & m_matchedSteroClusters;
112 Add(CollectorHelper& ih) :
h(ih){}
117 CollectorHelper & collector() {
125 Collector & i_collector,
126 CollectorMatched & i_collectorMatched,
128 std::vector<SiStripRecHit2D::ClusterRef::key_type> & i_matchedSteroClusters
130 m_collector(i_collector),
131 m_collectorMatched(i_collectorMatched),
132 m_fillerRphiUnm(i_fillerRphiUnm),
133 m_matchedSteroClusters(i_matchedSteroClusters) {}
136 if (!m_collectorMatched.empty()){
137 nmatch+=m_collectorMatched.size();
139 edm = m_collectorMatched.end();
142 m_collector.push_back(*itm);
144 m_matchedSteroClusters.push_back(itm->stereoClusterRef().key());
146 m_collectorMatched.clear();
149 m_fillerRphiUnm.push_back(*it);
167 std::vector<SiStripRecHit2D::ClusterRef::key_type> matchedSteroClusters;
175 if (partnerId == 0) {
177 if (!rphiHits.
empty()) {
188 if (itStereoDet == edStereoDet) {
190 if (!rphiHits.
empty()) {
204 Collector collector(*output.
matched, specDetId.glued());
210 matchedSteroClusters.clear();
213 CollectorHelper chelper(collector, collectorMatched,
218 stereoHits.
begin(),stereoHits.
end(),gluedDet,trackdirection,chelper);
219 nmatch+=chelper.nmatch;
224 stereoSimpleHits.reserve(stereoHits.
size());
226 stereoSimpleHits.push_back(&*it);
230 matcher->match(&(*it),stereoSimpleHits.begin(),stereoSimpleHits.end(),collectorMatched,gluedDet,trackdirection);
231 if (collectorMatched.
size()>0){
232 nmatch+=collectorMatched.
size();
234 edm = collectorMatched.
end();
237 collector.push_back(*itm);
239 matchedSteroClusters.push_back(itm->stereoClusterRef().key());
241 collectorMatched.
clear();
244 fillerRphiUnm.push_back(*it);
252 if (collector.empty()) collector.abort();
255 if (fillerRphiUnm.empty()) fillerRphiUnm.abort();
259 std::sort(matchedSteroClusters.begin(), matchedSteroClusters.end());
261 if (!std::binary_search(matchedSteroClusters.begin(), matchedSteroClusters.end(), it->cluster().key())) {
262 fillerStereoUnm.push_back(*it);
265 if (fillerStereoUnm.empty()) fillerStereoUnm.abort();
274 if (partnerId == 0)
continue;
276 if (itRPhiDet == edRPhiDet) {
277 if (!stereoHits.
empty()) {
288 <<
" matched RecHits\n";
295 short badApvs =
quality->getBadApvs(detid);
296 short badFibers =
quality->getBadFibers(detid);
297 for (
int j = 0;
j < 6;
j++) {
298 bad128StripBlocks[
j] = (badApvs & (1 <<
j));
300 for (
int j = 0;
j < 3;
j++) {
301 if (badFibers & (1 <<
j)) {
302 bad128StripBlocks[2*
j+0] =
true;
303 bad128StripBlocks[2*
j+1] =
true;
314 if ( bad128StripBlocks[cluster.
firstStrip() >> 7] ) {
316 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter()-0.499999) >> 7] ) {
321 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter()-0.499999) >> 7] ) {
334 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