19 maskBad128StripBlocks(conf.getParameter<
bool>(
"MaskBadAPVFibers")),
34 desc.add<
bool>(
"useSiStripQuality",
false);
35 desc.add<
bool>(
"MaskBadAPVFibers",
false);
36 desc.add<
bool>(
"doMatching",
true);
60 for (
auto const& DS : *inputhandle) {
67 bool bad128StripBlocks[6];
71 for (
auto const& cluster : DS) {
72 if (
isMasked(cluster, bad128StripBlocks))
80 if (collector.
empty())
90 struct CollectorHelper {
96 Collector& m_collector;
97 CollectorMatched& m_collectorMatched;
99 std::vector<SiStripRecHit2D::ClusterRef::key_type>& m_matchedSteroClusters;
108 Add(CollectorHelper& ih) :
h(ih) {}
113 CollectorHelper& collector() {
return *
this; }
117 CollectorHelper(Collector& i_collector,
118 CollectorMatched& i_collectorMatched,
120 std::vector<SiStripRecHit2D::ClusterRef::key_type>& i_matchedSteroClusters)
122 m_collector(i_collector),
123 m_collectorMatched(i_collectorMatched),
124 m_fillerRphiUnm(i_fillerRphiUnm),
125 m_matchedSteroClusters(i_matchedSteroClusters) {}
128 if (!m_collectorMatched.empty()) {
129 nmatch += m_collectorMatched.
size();
131 edm = m_collectorMatched.end();
134 m_collector.push_back(*itm);
136 m_matchedSteroClusters.push_back(itm->stereoClusterRef().key());
138 m_collectorMatched.clear();
156 std::vector<SiStripRecHit2D::ClusterRef::key_type> matchedSteroClusters;
165 if (partnerId == 0) {
167 if (!rphiHits.
empty()) {
178 if (itStereoDet == edStereoDet) {
180 if (!rphiHits.
empty()) {
199 matchedSteroClusters.clear();
202 CollectorHelper chelper(collector, collectorMatched, fillerRphiUnm, matchedSteroClusters);
204 rphiHits.
begin(), rphiHits.
end(), stereoHits.
begin(), stereoHits.
end(), gluedDet, trackdirection, chelper);
205 nmatch += chelper.nmatch;
210 stereoSimpleHits.reserve(stereoHits.
size());
213 stereoSimpleHits.push_back(&*
it);
218 &(*
it), stereoSimpleHits.begin(), stereoSimpleHits.end(), collectorMatched, gluedDet, trackdirection);
219 if (collectorMatched.
size() > 0) {
220 nmatch += collectorMatched.
size();
222 edm = collectorMatched.
end();
225 collector.push_back(*itm);
227 matchedSteroClusters.push_back(itm->stereoClusterRef().key());
229 collectorMatched.
clear();
232 fillerRphiUnm.push_back(*
it);
239 if (collector.empty())
243 if (fillerRphiUnm.empty())
244 fillerRphiUnm.abort();
248 std::sort(matchedSteroClusters.begin(), matchedSteroClusters.end());
251 if (!std::binary_search(matchedSteroClusters.begin(), matchedSteroClusters.end(),
it->cluster().key())) {
252 fillerStereoUnm.push_back(*
it);
255 if (fillerStereoUnm.empty())
256 fillerStereoUnm.abort();
267 if (itRPhiDet == edRPhiDet) {
268 if (!stereoHits.
empty()) {
276 edm::LogInfo(
"SiStripRecHitConverter") <<
"found\n" << nmatch <<
" matched RecHits\n";
283 for (
int j = 0;
j < 6;
j++) {
284 bad128StripBlocks[
j] = (badApvs & (1 <<
j));
286 for (
int j = 0;
j < 3;
j++) {
287 if (badFibers & (1 <<
j)) {
288 bad128StripBlocks[2 *
j + 0] =
true;
289 bad128StripBlocks[2 *
j + 1] =
true;
297 if (bad128StripBlocks[cluster.
firstStrip() >> 7]) {
299 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter() - 0.499999) >> 7]) {
304 bad128StripBlocks[static_cast<int32_t>(cluster.
barycenter() - 0.499999) >> 7]) {
314 if (stripdet ==
nullptr)
315 edm::LogWarning(
"SiStripRecHitConverter") <<
"Detid=" <<
id <<
" not found";
std::pair< LocalPoint, LocalError > LocalValues
unsigned int partnerDetId() const
void push_back(data_type const &d)
edm::ESGetToken< SiStripRecHitMatcher, TkStripCPERecord > matcherToken
T getParameter(std::string const &) const
void initialize(const edm::EventSetup &)
uint16_t firstStrip() const
Local3DVector LocalVector
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
unsigned int stereo() const
stereo
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters <p) const
short getBadFibers(uint32_t detid) const
void run(edm::Handle< edmNew::DetSetVector< SiStripCluster > > input, products &output)
edm::ESGetToken< StripClusterParameterEstimator, TkStripCPERecord > cpeToken
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
SiStripRecHitConverterAlgorithm(const edm::ParameterSet &, edm::ConsumesCollector)
const SiStripRecHitMatcher * matcher
data_type const * const_iterator
bool isMasked(const SiStripCluster &cluster, bool bad128StripBlocks[6]) const
static std::string const input
const StripClusterParameterEstimator * parameterestimator
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken
SiStripCluster const & amplitudes() const
const TrackerGeometry * tracker
void fillBad128StripBlocks(const uint32_t detid, bool bad128StripBlocks[6]) const
const TrackerGeomDet * idToDet(DetId) const override
bool useModule(const uint32_t id) const
const SiStripQuality * quality
Log< level::Info, false > LogInfo
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void match(products &output, LocalVector trackdirection) const
std::vector< const SiStripRecHit2D * > SimpleHitCollection
SiStripRecHit2DCollection::FastFiller Collector
void doubleMatch(MonoIterator monoRHiter, MonoIterator monoRHend, StereoIterator seconditer, StereoIterator seconditerend, const GluedGeomDet *gluedDet, LocalVector trdir, CollectorHelper &collectorHelper) const
bool maskBad128StripBlocks
Log< level::Warning, false > LogWarning
static void fillPSetDescription(edm::ParameterSetDescription &desc)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
bool IsModuleUsable(uint32_t detid) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerToken
short getBadApvs(uint32_t detid) const