19 if (dynamic_cast<const StripGeomDetUnit*>(gdet) == 0) {
20 throw MeasurementDetException(
"TkStripMeasurementDet constructed with a GeomDet which is not a StripGeomDetUnit");
24 TkStripMeasurementDet::RecHitContainer
31 result.reserve(detSet.size());
32 for ( new_const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
33 if (isMasked(*ci))
continue;
37 result.push_back( buildRecHit( cluster, ts));
38 else LogDebug(
"TkStripMeasurementDet")<<
"skipping this str from last iteration on"<<rawId()<<
" key: "<<cluster.key();
42 result.reserve(ce-ci);
43 for (; ci != ce; ++ci){
45 if (isMasked(*clusterRef))
continue;
47 result.push_back( buildRecHit( clusterRef, ts));
48 else LogDebug(
"TkStripMeasurementDet")<<
"skipping this reg str from last iteration on"<<rawId()<<
" key: "<<clusterRef.key();
58 RecHitContainer & result, std::vector<float> & diffs )
const {
59 if ( (!isActive(data)) || isEmpty(data.
stripData()))
return false;
61 auto oldSize = result.size();
63 float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.
localPosition()).
x();
68 std::find_if( detSet.begin(), detSet.end(), [utraj](
const SiStripCluster&
hit) {
return hit.barycenter() > utraj; });
70 if ( rightCluster != detSet.begin()) {
72 auto leftCluster = rightCluster;
73 while ( --leftCluster >= detSet.begin()) {
76 if(!isCompatible)
break;
79 for ( ; rightCluster != detSet.end(); rightCluster++) {
82 if(!isCompatible)
break;
88 LogDebug(
"TkStripMeasurementDet")<<
" finding left/ right";
89 unsigned int rightCluster = beginClusterI(data.
stripData());
90 unsigned int endCluster = endClusterI(data.
stripData());
91 result.reserve(endCluster-rightCluster);
92 for (; rightCluster!= endCluster;++rightCluster){
94 if (clusterref->barycenter() > utraj)
break;
97 unsigned int leftCluster = 1;
98 for (
unsigned int iReadBackWard=1; iReadBackWard<=(rightCluster-beginClusterI(data.
stripData())) ; ++iReadBackWard){
99 leftCluster=rightCluster-iReadBackWard;
102 if(!isCompatible)
break;
104 for ( ; rightCluster != endCluster; ++rightCluster) {
107 if(!isCompatible)
break;
110 return result.size()>oldSize;
115 TempMeasurements & result)
const {
117 if (!isActive(data)) {
118 LogDebug(
"TkStripMeasurementDet")<<
" found an inactive module "<<rawId();
124 LogDebug(
"TkStripMeasurementDet")<<
" found hit on this module "<<rawId();
126 std::vector<float> diffs;
127 if (recHits(stateOnThisDet,est,data,result.hits,result.distances))
return true;
138 float utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.
localPosition()).
x();
140 if (testStrips(utraj,uerr)) {
161 if (isEmpty(data.
stripData()) || !isActive(data))
return;
165 result.reserve(detSet.size());
166 for ( new_const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
167 if (isMasked(*ci))
continue;
171 buildSimpleRecHit( cluster, ts,result);
172 else LogDebug(
"TkStripMeasurementDet")<<
"skipping this str from last iteration on"<<rawId()<<
" key: "<<cluster.key();
175 unsigned int ci = beginClusterI(data.
stripData()), ce = endClusterI(data.
stripData());
176 result.reserve(ce-ci);
177 for (;ci != ce;++ci){
179 if (isMasked(*clusterRef))
continue;
181 buildSimpleRecHit( clusterRef, ts,result);
182 else LogDebug(
"TkStripMeasurementDet")<<
"skipping this reg str from last iteration on"<<rawId()<<
" key: "<<clusterRef.key();
190 TkStripMeasurementDet::testStrips(
float utraj,
float uerr)
const {
191 int16_t
start = (int16_t) std::max<float>(utraj - 3.
f*uerr, 0);
192 int16_t
end = (int16_t) std::min<float>(utraj + 3.
f*uerr, totalStrips());
204 typedef std::vector<BadStripBlock>::const_iterator BSBIT;
206 int16_t
bad = 0, largestBadBlock = 0;
207 for (BSBIT bsbc = badStripBlocks().begin(), bsbe = badStripBlocks().end(); bsbc != bsbe; ++bsbc) {
208 if (bsbc->last < start)
continue;
209 if (bsbc->first > end)
break;
211 if (thisBad > largestBadBlock) largestBadBlock = thisBad;
215 bool ok = (bad < (end-
start)) &&
216 (uint16_t(bad) <= badStripCuts().maxBad) &&
217 (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
LocalPoint localPosition() const
edm::Handle< edm::LazyGetter< SiStripCluster > > & regionalHandle()
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 T & max(const T &a, const T &b)
Ref< LazyGetter< T >, T, FindValue< T > > makeRefToLazyGetter(const Handle< LazyGetter< T > > &handle, const uint32_t index)
const LocalTrajectoryError & localError() const
char data[epos_bytes_allocation]
edm::Handle< edmNew::DetSetVector< SiStripCluster > > & handle()
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)