00001 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" 00002 00003 SiPixelRecHit::SiPixelRecHit( const LocalPoint& pos, const LocalError& err, 00004 const DetId& id, 00005 SiPixelClusterRefNew const& cluster): 00006 BaseSiTrackerRecHit2DLocalPos(pos,err,id), 00007 qualWord_(0), 00008 cluster_(cluster) 00009 { 00010 } 00011 00012 bool SiPixelRecHit::sharesInput( const TrackingRecHit* other, 00013 SharedInputType what) const 00014 { 00015 if (geographicalId() != other->geographicalId()) return false; 00016 if(! other->isValid()) return false; 00017 00018 const SiPixelRecHit* otherCast = static_cast<const SiPixelRecHit*>(other); 00019 00020 return cluster_ == otherCast->cluster(); 00021 } 00022 00023 //--- The overall probability. flags is the 32-bit-packed set of flags that 00024 //--- our own concrete implementation of clusterProbability() uses to direct 00025 //--- the computation based on the information stored in the quality word 00026 //--- (and which was computed by the CPE). The default of flags==0 returns 00027 //--- probX*probY*(1-log(probX*probY)) because of Morris' note. 00028 //--- Flags are static and kept in the transient rec hit. 00029 float SiPixelRecHit::clusterProbability(unsigned int flags) const 00030 { 00031 if (!hasFilledProb()) { 00032 return 1; 00033 } 00034 else if (flags == 1) { 00035 return probabilityXY() * probabilityQ(); 00036 } 00037 else if (flags == 2) { 00038 return probabilityQ(); 00039 } 00040 else { 00041 return probabilityXY(); 00042 } 00043 } 00044