19 if (dynamic_cast<const StripGeomDetUnit*>(gdet) == 0) {
20 throw MeasurementDetException(
"TkStripMeasurementDet constructed with a GeomDet which is not a StripGeomDetUnit");
29 const detset & detSet = data.stripData().detSet(
index());
30 for ( auto ci = detSet.
begin(); ci != detSet.
end(); ++ ci ) {
31 if (isMasked(*ci))
continue;
40 TkStripMeasurementDet::RecHitContainer
45 const detset & detSet = data.stripData().detSet(index());
46 result.reserve(detSet.
size());
47 for ( new_const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
48 if (isMasked(*ci))
continue;
52 result.push_back( buildRecHit( cluster, ts));
53 else LogDebug(
"TkStripMeasurementDet")<<
"skipping this str from last iteration on"<<rawId()<<
" key: "<<cluster.key();
61 bool TkStripMeasurementDet::recHits(SimpleHitContainer & result,
65 auto oldSize = result.size();
67 float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).
x();
68 const detset & detSet = data.stripData().detSet(index());
70 std::find_if( detSet.begin(), detSet.end(), [utraj](
const SiStripCluster&
hit) {
return hit.barycenter() > utraj; });
73 std::vector<SiStripRecHit2D>
tmp;
74 if ( rightCluster != detSet.begin()) {
76 auto leftCluster = rightCluster;
77 while ( --leftCluster >= detSet.begin()) {
80 if(!isCompatible)
break;
81 for (
auto &&
h: tmp) result.push_back(
new SiStripRecHit2D(std::move(
h))); tmp.clear();
84 for ( ; rightCluster != detSet.end(); rightCluster++) {
87 if(!isCompatible)
break;
88 for (
auto &&
h: tmp) result.push_back(
new SiStripRecHit2D(std::move(
h))); tmp.clear();
91 return result.size()>oldSize;
99 std::vector<SiStripRecHit2D> &result)
const {
102 auto oldSize = result.size();
104 float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
105 const detset & detSet = data.stripData().detSet(index());
107 std::find_if( detSet.begin(), detSet.end(), [utraj](
const SiStripCluster& hit) {
return hit.barycenter() > utraj; });
109 if ( rightCluster != detSet.begin()) {
111 auto leftCluster = rightCluster;
112 while ( --leftCluster >= detSet.begin()) {
115 if(!isCompatible)
break;
118 for ( ; rightCluster != detSet.end(); rightCluster++) {
121 if(!isCompatible)
break;
124 return result.size()>oldSize;
131 RecHitContainer & result, std::vector<float> & diffs )
const {
134 auto oldSize = result.size();
136 float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
138 const detset & detSet = data.stripData().detSet(index());
140 std::find_if( detSet.begin(), detSet.end(), [utraj](
const SiStripCluster& hit) {
return hit.barycenter() > utraj; });
142 if ( rightCluster != detSet.begin()) {
144 auto leftCluster = rightCluster;
145 while ( --leftCluster >= detSet.begin()) {
148 if(!isCompatible)
break;
151 for ( ; rightCluster != detSet.end(); rightCluster++) {
154 if(!isCompatible)
break;
157 return result.size()>oldSize;
162 TempMeasurements & result)
const {
164 if (!isActive(data)) {
165 LogDebug(
"TkStripMeasurementDet")<<
" found an inactive module "<<rawId();
166 result.add(theInactiveHit, 0.
F);
171 LogDebug(
"TkStripMeasurementDet")<<
" found hit on this module "<<rawId();
173 std::vector<float> diffs;
174 if (recHits(stateOnThisDet,est,data,result.hits,result.distances))
return true;
181 result.add(theMissingHit, 0.
F);
185 float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.
localPosition()).
x();
187 if (testStrips(utraj,uerr)) {
189 result.add(theMissingHit, 0.
F);
194 result.add(theInactiveHit, 0.
F);
208 if (isEmpty(data.
stripData()) || !isActive(data))
return;
211 result.reserve(detSet.size());
212 for ( new_const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
213 if (isMasked(*ci))
continue;
217 buildSimpleRecHit( cluster, ts,result);
218 else LogDebug(
"TkStripMeasurementDet")<<
"skipping this str from last iteration on"<<rawId()<<
" key: "<<cluster.key();
224 std::tuple<TkStripRecHitIter,TkStripRecHitIter>
227 if (isEmpty(data.
stripData()) || !isActive(data))
return std::tuple<TkStripRecHitIter,TkStripRecHitIter>();
235 while (!hi.
empty()) {
237 auto const & data = *hi.
data;
238 if (isMasked(*ci))
continue;
245 SiStripRecHit2D TkStripMeasurementDet::hit(
TkStripRecHitIter const & hi )
const {
248 auto const & data = *hi.
data;
249 auto const & ltp = *hi.
tsos;
252 LocalValues lv = cpe()->localParameters( *cluster, gdu, ltp);
253 return SiStripRecHit2D(lv.first,lv.second, gdu, cluster);
257 TkStripMeasurementDet::testStrips(
float utraj,
float uerr)
const {
258 int16_t
start = (int16_t) std::max<float>(utraj - 3.
f*uerr, 0);
259 int16_t end = (int16_t) std::min<float>(utraj + 3.
f*uerr, totalStrips());
271 typedef std::vector<BadStripBlock>::const_iterator BSBIT;
273 int16_t
bad = 0, largestBadBlock = 0;
274 for (BSBIT bsbc = badStripBlocks().begin(), bsbe = badStripBlocks().end(); bsbc != bsbe; ++bsbc) {
275 if (bsbc->last < start)
continue;
276 if (bsbc->first > end)
break;
278 if (thisBad > largestBadBlock) largestBadBlock = thisBad;
282 bool ok = (bad < (end-
start)) &&
283 (uint16_t(bad) <= badStripCuts().maxBad) &&
284 (uint16_t(largestBadBlock) <= badStripCuts().maxConsecutiveBad);
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)
tuple start
Check for commandline option errors.
const StripDetset & detSet(int i) const
const TrajectoryStateOnSurface * tsos
LocalPoint localPosition() const
const StMeasurementDetSet & stripData() const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
const std::vector< bool > & stripClustersToSkip() const
LocalError positionError() const
int bad(Items const &cont)
const MeasurementTrackerEvent * data
const T & max(const T &a, const T &b)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const LocalTrajectoryError & localError() const
for(const auto &pset:thresholds)
new_const_iterator clusterI
return(e1-e2)*(e1-e2)+dp *dp
std::vector< std::vector< double > > tmp
char data[epos_bytes_allocation]
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
volatile std::atomic< bool > shutdown_flag false
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
tuple size
Write out results.