CMS 3D CMS Logo

TkStripMeasurementDet Class Reference

#include <RecoTracker/MeasurementDet/interface/TkStripMeasurementDet.h>

Inheritance diagram for TkStripMeasurementDet:

MeasurementDet

List of all members.

Public Types

typedef std::vector
< SiStripCluster >
::const_iterator 
const_iterator
typedef edmNew::DetSet
< SiStripCluster
detset
typedef
StripClusterParameterEstimator::LocalValues 
LocalValues
typedef detset::const_iterator new_const_iterator
typedef SiStripRecHit2D::ClusterRef SiStripClusterRef
typedef edm::LazyGetter
< SiStripCluster >::value_ref 
SiStripRegionalClusterRef

Public Member Functions

TransientTrackingRecHit::RecHitPointer buildRecHit (const SiStripRegionalClusterRef &, const LocalTrajectoryParameters &ltp) const
TransientTrackingRecHit::RecHitPointer buildRecHit (const SiStripClusterRef &, const LocalTrajectoryParameters &ltp) const
virtual std::vector
< TrajectoryMeasurement
fastMeasurements (const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const
 faster version in case the TrajectoryState on the surface of the Det is already available.
std::vector< BadStripBlock > & getBadStripBlocks ()
bool hasAllGoodChannels () const
 does this module have at least one bad strip, APV or channel?
bool isActive () const
 Is this module active in reconstruction?
bool isEmpty ()
virtual RecHitContainer recHits (const TrajectoryStateOnSurface &) const
void set128StripStatus (bool good, int idx=-1)
 Sets the status of a block of 128 strips (or all blocks if idx=-1).
void setActive (bool active)
 Turn on/off the module for reconstruction (using info from DB, usually).
void setEmpty ()
void setMaskBad128StripBlocks (bool maskThem)
int size ()
const StripGeomDetUnitspecificGeomDet () const
bool testStrips (float utraj, float uerr) const
 return true if there are 'enough' good strips in the utraj +/- 3 uerr range.
const detsettheSet ()
 TkStripMeasurementDet (const GeomDet *gdet, const StripClusterParameterEstimator *cpe, bool regional)
void update (std::vector< SiStripCluster >::const_iterator begin, std::vector< SiStripCluster >::const_iterator end, const edm::Handle< edm::LazyGetter< SiStripCluster > > h, unsigned int id)
void update (const detset &detSet, const edm::Handle< edmNew::DetSetVector< SiStripCluster > > h, unsigned int id)
virtual ~TkStripMeasurementDet ()

Private Member Functions

bool isMasked (const SiStripCluster &cluster) const

Private Attributes

bool active_
bool bad128Strip_ [6]
std::vector< BadStripBlockbadStripBlocks_
std::vector< SiStripCluster >
::const_iterator 
beginCluster
detset detSet_
bool empty
std::vector< SiStripCluster >
::const_iterator 
endCluster
edm::Handle
< edmNew::DetSetVector
< SiStripCluster > > 
handle_
bool hasAny128StripBad_
unsigned int id_
bool isRegional
bool maskBad128StripBlocks_
edm::Handle< edm::LazyGetter
< SiStripCluster > > 
regionalHandle_
const
StripClusterParameterEstimator
theCPE
const StripGeomDetUnittheStripGDU
int totalStrips_

Classes

struct  BadStripBlock


Detailed Description

Definition at line 20 of file TkStripMeasurementDet.h.


Member Typedef Documentation

typedef std::vector<SiStripCluster>::const_iterator TkStripMeasurementDet::const_iterator

Definition at line 34 of file TkStripMeasurementDet.h.

typedef edmNew::DetSet<SiStripCluster> TkStripMeasurementDet::detset

Definition at line 31 of file TkStripMeasurementDet.h.

typedef StripClusterParameterEstimator::LocalValues TkStripMeasurementDet::LocalValues

Definition at line 25 of file TkStripMeasurementDet.h.

typedef detset::const_iterator TkStripMeasurementDet::new_const_iterator

Definition at line 32 of file TkStripMeasurementDet.h.

typedef SiStripRecHit2D::ClusterRef TkStripMeasurementDet::SiStripClusterRef

Definition at line 27 of file TkStripMeasurementDet.h.

typedef edm::LazyGetter<SiStripCluster>::value_ref TkStripMeasurementDet::SiStripRegionalClusterRef

Definition at line 29 of file TkStripMeasurementDet.h.


Constructor & Destructor Documentation

virtual TkStripMeasurementDet::~TkStripMeasurementDet (  )  [inline, virtual]

Definition at line 36 of file TkStripMeasurementDet.h.

00036 {}

TkStripMeasurementDet::TkStripMeasurementDet ( const GeomDet gdet,
const StripClusterParameterEstimator cpe,
bool  regional 
)

Definition at line 16 of file TkStripMeasurementDet.cc.

References GeomDet::geographicalId(), id_, StripTopology::nstrips(), DetId::rawId(), specificGeomDet(), StripGeomDetUnit::specificTopology(), theStripGDU, and totalStrips_.

00018                                                              : 
00019     MeasurementDet (gdet),
00020     theCPE(cpe),
00021     empty(true),
00022     isRegional(regional)
00023   {
00024     theStripGDU = dynamic_cast<const StripGeomDetUnit*>(gdet);
00025     if (theStripGDU == 0) {
00026       throw MeasurementDetException( "TkStripMeasurementDet constructed with a GeomDet which is not a StripGeomDetUnit");
00027     }
00028 
00029     //intialize the detId !
00030     id_ = gdet->geographicalId().rawId();
00031     //initalize the total number of strips
00032     totalStrips_ =  specificGeomDet().specificTopology().nstrips();
00033   }


Member Function Documentation

TransientTrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const SiStripRegionalClusterRef cluster,
const LocalTrajectoryParameters ltp 
) const

Definition at line 180 of file TkStripMeasurementDet.cc.

References TSiStripRecHit2DLocalPos::build(), MeasurementDet::geomDet(), ClusterParameterEstimator< T >::localParameters(), lv, specificGeomDet(), and theCPE.

00182 {
00183   const GeomDetUnit& gdu( specificGeomDet());
00184   LocalValues lv = theCPE->localParameters( *cluster, gdu, ltp);
00185   return TSiStripRecHit2DLocalPos::build( lv.first, lv.second, &geomDet(), cluster, theCPE);
00186 }

TransientTrackingRecHit::RecHitPointer TkStripMeasurementDet::buildRecHit ( const SiStripClusterRef cluster,
const LocalTrajectoryParameters ltp 
) const

Definition at line 171 of file TkStripMeasurementDet.cc.

References TSiStripRecHit2DLocalPos::build(), MeasurementDet::geomDet(), ClusterParameterEstimator< T >::localParameters(), lv, specificGeomDet(), and theCPE.

Referenced by fastMeasurements(), and recHits().

00173 {
00174   const GeomDetUnit& gdu( specificGeomDet());
00175   LocalValues lv = theCPE->localParameters( *cluster, gdu, ltp);
00176   return TSiStripRecHit2DLocalPos::build( lv.first, lv.second, &geomDet(), cluster, theCPE);
00177 }

std::vector< TrajectoryMeasurement > TkStripMeasurementDet::fastMeasurements ( const TrajectoryStateOnSurface stateOnThisDet,
const TrajectoryStateOnSurface startingState,
const Propagator ,
const MeasurementEstimator  
) const [virtual]

faster version in case the TrajectoryState on the surface of the Det is already available.

The first TrajectoryStateOnSurface is on the surface of this Det, and the second TrajectoryStateOnSurface is the statrting state, usually not on the surface of this Det. The stateOnThisDet should the result of
prop.propagate( startingState, this->surface())

Implements MeasurementDet.

Definition at line 37 of file TkStripMeasurementDet.cc.

References active_, edmNew::DetSet< T >::begin(), beginCluster, InvalidTransientRecHit::build(), buildRecHit(), detSet_, empty, edmNew::DetSet< T >::end(), endCluster, MeasurementEstimator::estimate(), MeasurementDet::geomDet(), handle_, TrajectoryStateOnSurface::hasError(), TrackingRecHit::inactive, isMasked(), isRegional, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), TrajectoryStateOnSurface::localPosition(), edmNew::makeRefTo(), edm::makeRefToLazyGetter(), Topology::measurementError(), Topology::measurementPosition(), TrackingRecHit::missing, LocalTrajectoryError::positionError(), regionalHandle_, HLT_VtxMuL3::result, python::multivaluedict::sort(), StripGeomDetUnit::specificTopology(), funct::sqrt(), testStrips(), theStripGDU, and x.

00041 { 
00042   std::vector<TrajectoryMeasurement> result;
00043 
00044   if (active_ == false) {
00045     result.push_back( TrajectoryMeasurement( stateOnThisDet, 
00046                 InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 
00047                 0.F));
00048     //    LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " inactive";
00049     return result;
00050   }
00051  
00052   float utraj =  theStripGDU->specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();
00053   float uerr;
00054   //  if (theClusterRange.first == theClusterRange.second) { // empty
00055   if (empty  == true){
00056     //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty ";
00057     if (stateOnThisDet.hasError()){
00058     uerr= sqrt(theStripGDU->specificTopology().measurementError(stateOnThisDet.localPosition(),stateOnThisDet.localError().positionError()).uu());
00059      if (testStrips(utraj,uerr)) {
00060         result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::missing), 0.F));
00061      } else { 
00062         result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 0.F));
00063      }
00064     }else{
00065       result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::missing), 0.F));
00066     }
00067     return result;
00068   }
00069   
00070   if(!isRegional){//old implemetation with DetSet
00071     new_const_iterator rightCluster = 
00072       std::find_if( detSet_.begin(), detSet_.end(), StripClusterAboveU( utraj)); //FIXME
00073 
00074     if ( rightCluster != detSet_.begin()) {
00075       // there are hits on the left of the utraj
00076       new_const_iterator leftCluster = rightCluster;
00077       while ( --leftCluster >=  detSet_.begin()) {
00078         if (isMasked(*leftCluster)) continue;
00079         //      TransientTrackingRecHit* recHit = buildRecHit( *leftCluster, 
00080         SiStripClusterRef clusterref = edmNew::makeRefTo( handle_, leftCluster ); 
00081         TransientTrackingRecHit::RecHitPointer recHit = buildRecHit(clusterref, 
00082                                                                     stateOnThisDet.localParameters());
00083         std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, *recHit);
00084         if ( diffEst.first ) {
00085           result.push_back( TrajectoryMeasurement( stateOnThisDet, recHit, 
00086                                                    diffEst.second));
00087         }
00088         else break; // exit loop on first incompatible hit
00089       }
00090     }
00091     
00092     for ( ; rightCluster != detSet_.end(); rightCluster++) {
00093       if (isMasked(*rightCluster)) continue;
00094       SiStripClusterRef clusterref = edmNew::makeRefTo( handle_, rightCluster ); 
00095       TransientTrackingRecHit::RecHitPointer recHit = buildRecHit( clusterref, 
00096                                                                    stateOnThisDet.localParameters());
00097       std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, *recHit);
00098       if ( diffEst.first) {
00099         result.push_back( TrajectoryMeasurement( stateOnThisDet, recHit, 
00100                                                  diffEst.second));
00101       }
00102       else break; // exit loop on first incompatible hit
00103     }
00104   }// end block with DetSet
00105   else{
00106     const_iterator rightCluster = 
00107       std::find_if( beginCluster, endCluster, StripClusterAboveU( utraj));
00108 
00109     if ( rightCluster != beginCluster) {
00110       // there are hits on the left of the utraj
00111       const_iterator leftCluster = rightCluster;
00112       while ( --leftCluster >=  beginCluster) {
00113         if (isMasked(*leftCluster)) continue;
00114         //      TransientTrackingRecHit* recHit = buildRecHit( *leftCluster, 
00115         //std::cout << "=====making ref in fastMeas left " << std::endl;
00116         SiStripRegionalClusterRef clusterref = edm::makeRefToLazyGetter(regionalHandle_,leftCluster-regionalHandle_->begin_record());
00117         TransientTrackingRecHit::RecHitPointer recHit = buildRecHit(clusterref, 
00118                                                                     stateOnThisDet.localParameters());
00119         std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, *recHit);
00120         if ( diffEst.first ) {
00121           result.push_back( TrajectoryMeasurement( stateOnThisDet, recHit, 
00122                                                    diffEst.second));
00123         }
00124         else break; // exit loop on first incompatible hit
00125       }
00126     }
00127     
00128     for ( ; rightCluster != endCluster; rightCluster++) {
00129       if (isMasked(*rightCluster)) continue;
00130       //std::cout << "=====making ref in fastMeas rigth " << std::endl;
00131       SiStripRegionalClusterRef clusterref = edm::makeRefToLazyGetter(regionalHandle_,rightCluster-regionalHandle_->begin_record());
00132       TransientTrackingRecHit::RecHitPointer recHit = buildRecHit( clusterref, 
00133                                                                    stateOnThisDet.localParameters());
00134       std::pair<bool,double> diffEst = est.estimate(stateOnThisDet, *recHit);
00135       if ( diffEst.first) {
00136         result.push_back( TrajectoryMeasurement( stateOnThisDet, recHit, 
00137                                                  diffEst.second));
00138       }
00139       else break; // exit loop on first incompatible hit
00140     }
00141   }
00142 
00143 
00144   if ( result.empty()) {
00145     // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
00146     if (stateOnThisDet.hasError()){
00147     uerr= sqrt(theStripGDU->specificTopology().measurementError(stateOnThisDet.localPosition(),stateOnThisDet.localError().positionError()).uu());
00148      if (testStrips(utraj,uerr)) {
00149        //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, but active ";
00150        result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::missing), 0.F));
00151      } else { 
00152        //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " empty after search, and inactive ";
00153        result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::inactive), 0.F));
00154      }
00155     }else{
00156       result.push_back( TrajectoryMeasurement( stateOnThisDet, InvalidTransientRecHit::build(&geomDet(), TrackingRecHit::missing), 0.F));
00157     }
00158   }
00159   else {
00160     //LogDebug("TkStripMeasurementDet") << " DetID " << id_ << " full: " << (result.size()) << " compatible hits";
00161     // sort results according to estimator value
00162     if ( result.size() > 1) {
00163       sort( result.begin(), result.end(), TrajMeasLessEstim());
00164     }
00165   }
00166   return result;
00167 }

std::vector<BadStripBlock>& TkStripMeasurementDet::getBadStripBlocks (  )  [inline]

Definition at line 105 of file TkStripMeasurementDet.h.

References badStripBlocks_.

00105 { return badStripBlocks_; }

bool TkStripMeasurementDet::hasAllGoodChannels (  )  const [inline]

does this module have at least one bad strip, APV or channel?

Definition at line 92 of file TkStripMeasurementDet.h.

References badStripBlocks_, and hasAny128StripBad_.

Referenced by TkGluedMeasurementDet::fastMeasurements().

00092 { return !hasAny128StripBad_ && badStripBlocks_.empty(); }

bool TkStripMeasurementDet::isActive (  )  const [inline]

Is this module active in reconstruction?

Definition at line 89 of file TkStripMeasurementDet.h.

References active_.

Referenced by TkGluedMeasurementDet::fastMeasurements().

00089 { return active_; }

bool TkStripMeasurementDet::isEmpty (  )  [inline]

Definition at line 82 of file TkStripMeasurementDet.h.

References empty.

00082 {return empty;}

bool TkStripMeasurementDet::isMasked ( const SiStripCluster cluster  )  const [inline, private]

Definition at line 131 of file TkStripMeasurementDet.h.

References SiStripCluster::amplitudes(), bad128Strip_, SiStripCluster::barycenter(), and SiStripCluster::firstStrip().

Referenced by fastMeasurements(), and recHits().

00131                                                             {
00132       if ( bad128Strip_[cluster.firstStrip() >> 7] ) {
00133           if ( bad128Strip_[(cluster.firstStrip()+cluster.amplitudes().size())  >> 7] ||
00134                bad128Strip_[static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7] ) {
00135               return true;
00136           }
00137       } else {
00138           if ( bad128Strip_[(cluster.firstStrip()+cluster.amplitudes().size())  >> 7] &&
00139                bad128Strip_[static_cast<int32_t>(cluster.barycenter()-0.499999) >> 7] ) {
00140               return true;
00141           }
00142       }
00143       return false;
00144   }

TkStripMeasurementDet::RecHitContainer TkStripMeasurementDet::recHits ( const TrajectoryStateOnSurface ts  )  const [virtual]

Implements MeasurementDet.

Definition at line 190 of file TkStripMeasurementDet.cc.

References active_, edmNew::DetSet< T >::begin(), beginCluster, buildRecHit(), detSet_, empty, edmNew::DetSet< T >::end(), endCluster, handle_, isMasked(), isRegional, TrajectoryStateOnSurface::localParameters(), edmNew::makeRefTo(), edm::makeRefToLazyGetter(), regionalHandle_, and HLT_VtxMuL3::result.

Referenced by TkGluedMeasurementDet::recHits().

00191 {
00192   RecHitContainer result;
00193   if (empty == true) return result;
00194   if (active_ == false) return result; // GIO
00195 
00196   if(!isRegional){//old implemetation with DetSet
00197     for ( new_const_iterator ci = detSet_.begin(); ci != detSet_.end(); ++ ci ) {
00198       if (isMasked(*ci)) continue;
00199       // for ( ClusterIterator ci=theClusterRange.first; ci != theClusterRange.second; ci++) {
00200       SiStripClusterRef  cluster = edmNew::makeRefTo( handle_, ci ); 
00201       result.push_back( buildRecHit( cluster, ts.localParameters()));
00202     }
00203   }else{
00204     for (const_iterator ci = beginCluster ; ci != endCluster; ci++) {      
00205       if (isMasked(*ci)) continue;
00206       SiStripRegionalClusterRef clusterRef = edm::makeRefToLazyGetter(regionalHandle_,ci-regionalHandle_->begin_record());     
00207       result.push_back( buildRecHit( clusterRef, ts.localParameters()));
00208     }
00209   }
00210   return result;
00211 
00212 }

void TkStripMeasurementDet::set128StripStatus ( bool  good,
int  idx = -1 
)

Sets the status of a block of 128 strips (or all blocks if idx=-1).

Definition at line 216 of file TkStripMeasurementDet.cc.

References bad128Strip_, edm::pset::fill(), hasAny128StripBad_, and i.

00216                                                            { 
00217    if (idx == -1) {
00218        std::fill(bad128Strip_, bad128Strip_+6, !good);
00219        hasAny128StripBad_ = !good;
00220    } else {
00221        bad128Strip_[idx] = !good;
00222        if (good == false) {
00223             hasAny128StripBad_ = false;
00224        } else { // this should not happen, as usually you turn on all fibers
00225                 // and then turn off the bad ones, and not vice-versa,
00226                 // so I don't care if it's not optimized
00227             hasAny128StripBad_ = true;
00228             for (int i = 0; i < (totalStrips_ >> 7); i++) {
00229                 if (bad128Strip_[i] == false) hasAny128StripBad_ = false;
00230             }
00231        }    
00232    }
00233     
00234 }

void TkStripMeasurementDet::setActive ( bool  active  )  [inline]

Turn on/off the module for reconstruction (using info from DB, usually).

Definition at line 87 of file TkStripMeasurementDet.h.

References active_, and empty.

00087 { active_ = active; if (!active) empty = true; }

void TkStripMeasurementDet::setEmpty (  )  [inline]

Definition at line 63 of file TkStripMeasurementDet.h.

References empty.

Referenced by OnDemandMeasurementTracker::assign().

00063 {empty = true;}

void TkStripMeasurementDet::setMaskBad128StripBlocks ( bool  maskThem  )  [inline]

Definition at line 107 of file TkStripMeasurementDet.h.

References maskBad128StripBlocks_.

00107 { maskBad128StripBlocks_ = maskThem; }

int TkStripMeasurementDet::size ( void   )  [inline]

Definition at line 84 of file TkStripMeasurementDet.h.

References beginCluster, and endCluster.

00084 {return endCluster - beginCluster ; }

const StripGeomDetUnit& TkStripMeasurementDet::specificGeomDet (  )  const [inline]

Definition at line 73 of file TkStripMeasurementDet.h.

References theStripGDU.

Referenced by buildRecHit(), TkGluedMeasurementDet::testStrips(), and TkStripMeasurementDet().

00073 {return *theStripGDU;}

bool TkStripMeasurementDet::testStrips ( float  utraj,
float  uerr 
) const

return true if there are 'enough' good strips in the utraj +/- 3 uerr range.

Definition at line 237 of file TkStripMeasurementDet.cc.

References bad128Strip_, badStripBlocks_, end, int, min, and totalStrips_.

Referenced by fastMeasurements(), and TkGluedMeasurementDet::testStrips().

00237                                                                {
00238     int start = (int) (utraj - 3*uerr); if (start < 0) start = 0;
00239     int end   = (int) (utraj + 3*uerr); if (end > totalStrips_) end = totalStrips_;
00240 
00241     if (start >= end) { // which means either end <=0 or start >= totalStrips_
00242         /* LogDebug("TkStripMeasurementDet") << "Testing module " << id_ <<","<<
00243             " U = " << utraj << " +/- " << uerr << 
00244             "; Range [" << (utraj - 3*uerr) << ", " << (utraj + 3*uerr) << "] " << 
00245             ": YOU'RE COMPLETELY OFF THE MODULE."; */
00246         //return false; 
00247         return true;  // Wolfgang thinks this way is better
00248                       // and solves some problems with grouped ckf
00249     } 
00250 
00251     typedef std::vector<BadStripBlock>::const_iterator BSBIT;
00252     BSBIT bsbc = badStripBlocks_.begin(), bsbe = badStripBlocks_.end();
00253 
00254     int cur = start, curapv = start >> 7, good = 0;
00255     while (cur < end) {
00256         int nextapv = (cur & ~(127)) + 128;
00257         if (bad128Strip_[curapv]) { 
00258             cur = nextapv; continue;
00259         }
00260         int next = std::min(end, nextapv); // all before "next" is good for APVs and fibers 
00261                                            // [*] next > cur by contract.
00262         if (bsbc != bsbe) {  // are there any bad strips?
00263             // skip all blocks to our left
00264             while (bsbc->last < cur) { bsbc++; if (bsbc == bsbe) break; }
00265             if ((bsbc != bsbe)) {
00266                 if (bsbc->first <= cur) { // in the block
00267                     cur = bsbc->last+1; bsbc++;  continue;
00268                 } 
00269                 if (bsbc->first < next) { // there are bad strips before "next"
00270                     next = bsbc->first;   // so we better stop at the beginning of that block
00271                     // as we didn't fall in "if (bsbc->first <= cur)" we know
00272                     // cur < bsbc->first, so [*] is still true
00273                 }
00274             }
00275         }
00276         // because of [*] (next - cur) > 0
00277         good += next - cur; // all strips up to next-1 are good
00278         cur  = next;        // now reach for the unknown
00279    }
00280    
00281    /* LogDebug("TkStripMeasurementDet") << "Testing module " << id_ <<","<<
00282         " U = " << utraj << " +/- " << uerr << 
00283         "; Range [" << (utraj - 3*uerr) << ", " << (utraj + 3*uerr) << "] " << 
00284         "= [" << start << "," << end << "]" <<
00285         " total strips:" << (end-start) << ", good:" << good << ", bad:" << (end-start-good) << 
00286         ". " << (good >= 1 ? "OK" : "NO"); */
00287 
00288 //#define RecoTracker_MeasurementDet_TkStripMeasurementDet_RECOUNT_IN_SLOW_AND_STUPID_BUT_SAFE_WAY
00289 // I can be dangerous to blindly trust some "supposed-to-be-smart" algorithm ...
00290 // ... expecially if I wrote it   (gpetrucc)
00291 #ifdef  RecoTracker_MeasurementDet_TkStripMeasurementDet_RECOUNT_IN_SLOW_AND_STUPID_BUT_SAFE_WAY
00292     bsbc = badStripBlocks_.begin();
00293     cur  = start;
00294     int safegood = 0;
00295     while (cur < end) {
00296         if (bad128Strip_[cur >> 7]) { cur++; continue; }
00297         // skip all blocks to our left
00298         while ((bsbc != bsbe) && (bsbc->last < cur)) { bsbc++; }
00299         if ((bsbc != bsbe) && (bsbc->first <= cur)) { cur++; continue; }
00300         safegood++; cur++;
00301     }
00302     //LogDebug("TkStripMeasurementDet") << "Testing module " << id_ <<", "<<
00303     //        " safegood = " << safegood << " while good = " << good <<
00304     //        "; I am  " << (safegood == good ? "safe" : "STUPID"); // no offense to anyone, of course
00305 #endif // of #ifdef  RecoTracker_MeasurementDet_TkStripMeasurementDet_RECOUNT_IN_SLOW_AND_STUPID_BUT_SAFE_WAY
00306 
00307     return (good >= 1); //to be tuned
00308 }

const detset& TkStripMeasurementDet::theSet (  )  [inline]

Definition at line 83 of file TkStripMeasurementDet.h.

References detSet_.

00083 {return detSet_;}

void TkStripMeasurementDet::update ( std::vector< SiStripCluster >::const_iterator  begin,
std::vector< SiStripCluster >::const_iterator  end,
const edm::Handle< edm::LazyGetter< SiStripCluster > >  h,
unsigned int  id 
) [inline]

Definition at line 52 of file TkStripMeasurementDet.h.

References beginCluster, empty, endCluster, h, id_, isRegional, and regionalHandle_.

00054                                  { 
00055     beginCluster = begin;
00056     endCluster   = end;
00057     regionalHandle_ = h;
00058     id_ = id;
00059     empty = false;
00060     isRegional = true;
00061   }

void TkStripMeasurementDet::update ( const detset detSet,
const edm::Handle< edmNew::DetSetVector< SiStripCluster > >  h,
unsigned int  id 
) [inline]

Definition at line 42 of file TkStripMeasurementDet.h.

References detSet_, empty, h, handle_, id_, and isRegional.

Referenced by OnDemandMeasurementTracker::assign(), and MeasurementTracker::updateStrips().

00044                                  { 
00045     detSet_ = detSet; 
00046     handle_ = h;
00047     id_ = id;
00048     empty = false;
00049     isRegional = false;
00050   }


Member Data Documentation

bool TkStripMeasurementDet::active_ [private]

Definition at line 118 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), isActive(), recHits(), and setActive().

bool TkStripMeasurementDet::bad128Strip_[6] [private]

Definition at line 119 of file TkStripMeasurementDet.h.

Referenced by isMasked(), set128StripStatus(), and testStrips().

std::vector<BadStripBlock> TkStripMeasurementDet::badStripBlocks_ [private]

Definition at line 121 of file TkStripMeasurementDet.h.

Referenced by getBadStripBlocks(), hasAllGoodChannels(), and testStrips().

std::vector<SiStripCluster>::const_iterator TkStripMeasurementDet::beginCluster [private]

Definition at line 127 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), recHits(), size(), and update().

detset TkStripMeasurementDet::detSet_ [private]

Definition at line 113 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), recHits(), theSet(), and update().

bool TkStripMeasurementDet::empty [private]

Definition at line 116 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), isEmpty(), recHits(), setActive(), setEmpty(), and update().

std::vector<SiStripCluster>::const_iterator TkStripMeasurementDet::endCluster [private]

Definition at line 128 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), recHits(), size(), and update().

edm::Handle<edmNew::DetSetVector<SiStripCluster> > TkStripMeasurementDet::handle_ [private]

Definition at line 114 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), recHits(), and update().

bool TkStripMeasurementDet::hasAny128StripBad_ [private]

Definition at line 120 of file TkStripMeasurementDet.h.

Referenced by hasAllGoodChannels(), and set128StripStatus().

unsigned int TkStripMeasurementDet::id_ [private]

Definition at line 115 of file TkStripMeasurementDet.h.

Referenced by TkStripMeasurementDet(), and update().

bool TkStripMeasurementDet::isRegional [private]

Definition at line 125 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), recHits(), and update().

bool TkStripMeasurementDet::maskBad128StripBlocks_ [private]

Definition at line 120 of file TkStripMeasurementDet.h.

Referenced by setMaskBad128StripBlocks().

edm::Handle<edm::LazyGetter<SiStripCluster> > TkStripMeasurementDet::regionalHandle_ [private]

Definition at line 126 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), recHits(), and update().

const StripClusterParameterEstimator* TkStripMeasurementDet::theCPE [private]

Definition at line 112 of file TkStripMeasurementDet.h.

Referenced by buildRecHit().

const StripGeomDetUnit* TkStripMeasurementDet::theStripGDU [private]

Definition at line 111 of file TkStripMeasurementDet.h.

Referenced by fastMeasurements(), specificGeomDet(), and TkStripMeasurementDet().

int TkStripMeasurementDet::totalStrips_ [private]

Definition at line 122 of file TkStripMeasurementDet.h.

Referenced by testStrips(), and TkStripMeasurementDet().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:39 2009 for CMSSW by  doxygen 1.5.4