#include <RecHitsSortedInPhi.h>
Classes | |
struct | HitLessPhi |
class | HitWithPhi |
Public Types | |
typedef TransientTrackingRecHit::ConstRecHitPointer | Hit |
typedef std::vector < HitWithPhi >::const_iterator | HitIter |
typedef std::pair< HitIter, HitIter > | Range |
Public Member Functions | |
Range | all () const |
DoubleRange | doubleRange (float phiMin, float phiMax) const |
bool | empty () const |
GlobalPoint | gp (int i) const |
float | gv (int i) const |
std::vector< Hit > | hits (float phiMin, float phiMax) const |
std::vector< Hit > | hits () const |
void | hits (float phiMin, float phiMax, std::vector< Hit > &result) const |
float | phi (int i) const |
RecHitsSortedInPhi (const std::vector< Hit > &hits, GlobalPoint const &origin, DetLayer const *il) | |
float | rv (int i) const |
std::size_t | size () const |
Range | unsafeRange (float phiMin, float phiMax) const |
Static Public Member Functions | |
static void | copyResult (const Range &range, std::vector< Hit > &result) |
Public Attributes | |
std::vector< float > | drphi |
std::vector< float > | du |
std::vector< float > | dv |
bool | isBarrel |
DetLayer const * | layer |
std::vector< float > | lphi |
std::vector< HitWithPhi > | theHits |
GlobalPoint | theOrigin |
std::vector< float > | u |
std::vector< float > | v |
std::vector< float > | x |
std::vector< float > | y |
std::vector< float > | z |
A RecHit container sorted in phi. Provides fast access for hits in a given phi window using binary search.
Definition at line 15 of file RecHitsSortedInPhi.h.
Definition at line 18 of file RecHitsSortedInPhi.h.
typedef std::vector<HitWithPhi>::const_iterator RecHitsSortedInPhi::HitIter |
Definition at line 36 of file RecHitsSortedInPhi.h.
typedef std::pair<HitIter,HitIter> RecHitsSortedInPhi::Range |
Definition at line 37 of file RecHitsSortedInPhi.h.
RecHitsSortedInPhi::RecHitsSortedInPhi | ( | const std::vector< Hit > & | hits, |
GlobalPoint const & | origin, | ||
DetLayer const * | il | ||
) |
Definition at line 9 of file RecHitsSortedInPhi.cc.
References PV3DBase< T, PVType, FrameType >::basicVector(), drphi, du, dv, h, i, isBarrel, lphi, python::multivaluedict::sort(), theHits, u, v, x, y, and z.
: layer(il), isBarrel(il->isBarrel()), x(hits.size()),y(hits.size()),z(hits.size()),drphi(hits.size()), u(hits.size()),v(hits.size()),du(hits.size()),dv(hits.size()), lphi(hits.size()) { // standard region have origin as 0,0,z (not true!!!!0 // cosmic region never used here // assert(origin.x()==0 && origin.y()==0); for (std::vector<Hit>::const_iterator i=hits.begin(); i!=hits.end(); i++) { theHits.push_back(HitWithPhi(*i)); } std::sort( theHits.begin(), theHits.end(), HitLessPhi()); for (unsigned int i=0; i!=theHits.size(); ++i) { auto const & h = *theHits[i].hit(); auto const & gs = reinterpret_cast<TValidTrackingRecHit const &>(h).globalState(); auto loc = gs.position-origin.basicVector(); float lr = loc.perp(); // float lr = gs.position.perp(); float lz = gs.position.z(); float dr = gs.errorR; float dz = gs.errorZ; // r[i] = gs.position.perp(); // phi[i] = gs.position.barePhi(); x[i] = gs.position.x(); y[i] = gs.position.y(); z[i] = lz; drphi[i] = gs.errorRPhi; u[i] = isBarrel ? lr : lz; v[i] = isBarrel ? lz : lr; du[i] = isBarrel ? dr : dz; dv[i] = isBarrel ? dz : dr; lphi[i] = loc.barePhi(); } }
Range RecHitsSortedInPhi::all | ( | ) | const [inline] |
Definition at line 82 of file RecHitsSortedInPhi.h.
References theHits.
Referenced by HitQuadrupletGeneratorFromLayerPairForPhotonConversion::hitPairs(), and LayerHitMapCache::operator()().
RecHitsSortedInPhi::DoubleRange RecHitsSortedInPhi::doubleRange | ( | float | phiMin, |
float | phiMax | ||
) | const |
Definition at line 51 of file RecHitsSortedInPhi.cc.
References Geom::fpi(), Geom::ftwoPi(), Geom::pi(), diffTwoXMLs::r1, diffTwoXMLs::r2, theHits, and unsafeRange().
Referenced by HitPairGeneratorFromLayerPair::doublets().
{ Range r1,r2; if ( phiMin < phiMax) { if ( phiMin < -Geom::fpi()) { r1 = unsafeRange( phiMin + Geom::ftwoPi(), Geom::fpi()); r2 = unsafeRange( -Geom::fpi(), phiMax); } else if (phiMax > Geom::pi()) { r1 = unsafeRange( phiMin, Geom::fpi()); r2 = unsafeRange( -Geom::fpi(), phiMax-Geom::ftwoPi()); } else { r1 = unsafeRange( phiMin, phiMax); r2 = Range(theHits.begin(),theHits.begin()); } } else { r1 =unsafeRange( phiMin, Geom::fpi()); r2 =unsafeRange( -Geom::fpi(), phiMax); } return (DoubleRange){{int(r1.first-theHits.begin()),int(r1.second-theHits.begin()) ,int(r2.first-theHits.begin()),int(r2.second-theHits.begin())}}; }
bool RecHitsSortedInPhi::empty | ( | void | ) | const [inline] |
Definition at line 43 of file RecHitsSortedInPhi.h.
References theHits.
Referenced by HitPairGeneratorFromLayerPair::doublets(), HitQuadrupletGeneratorFromLayerPairForPhotonConversion::hitPairs(), and HitPairGeneratorFromLayerPairForPhotonConversion::hitPairs().
{ return theHits.empty(); }
GlobalPoint RecHitsSortedInPhi::gp | ( | int | i | ) | const [inline] |
float RecHitsSortedInPhi::gv | ( | int | i | ) | const [inline] |
void RecHitsSortedInPhi::hits | ( | float | phiMin, |
float | phiMax, | ||
std::vector< Hit > & | result | ||
) | const |
Definition at line 77 of file RecHitsSortedInPhi.cc.
References copyResult(), Geom::fpi(), Geom::ftwoPi(), Geom::pi(), and unsafeRange().
{ if ( phiMin < phiMax) { if ( phiMin < -Geom::fpi()) { copyResult( unsafeRange( phiMin + Geom::ftwoPi(), Geom::fpi()), result); copyResult( unsafeRange( -Geom::fpi(), phiMax), result); } else if (phiMax > Geom::pi()) { copyResult( unsafeRange( phiMin, Geom::fpi()), result); copyResult( unsafeRange( -Geom::fpi(), phiMax-Geom::ftwoPi()), result); } else { copyResult( unsafeRange( phiMin, phiMax), result); } } else { copyResult( unsafeRange( phiMin, Geom::fpi()), result); copyResult( unsafeRange( -Geom::fpi(), phiMax), result); } }
std::vector<Hit> RecHitsSortedInPhi::hits | ( | ) | const [inline] |
std::vector< RecHitsSortedInPhi::Hit > RecHitsSortedInPhi::hits | ( | float | phiMin, |
float | phiMax | ||
) | const |
Definition at line 98 of file RecHitsSortedInPhi.cc.
References hits(), and query::result.
Referenced by HitQuadrupletGeneratorFromLayerPairForPhotonConversion::hitPairs(), HitPairGeneratorFromLayerPairForPhotonConversion::hitPairs(), PixelTripletNoTipGenerator::hitTriplets(), and PixelTripletLowPtGenerator::hitTriplets().
float RecHitsSortedInPhi::phi | ( | int | i | ) | const [inline] |
float RecHitsSortedInPhi::rv | ( | int | i | ) | const [inline] |
std::size_t RecHitsSortedInPhi::size | ( | void | ) | const [inline] |
Definition at line 44 of file RecHitsSortedInPhi.h.
References theHits.
Referenced by HitPairGeneratorFromLayerPair::doublets().
{ return theHits.size();}
RecHitsSortedInPhi::Range RecHitsSortedInPhi::unsafeRange | ( | float | phiMin, |
float | phiMax | ||
) | const |
Definition at line 106 of file RecHitsSortedInPhi.cc.
References theHits.
Referenced by doubleRange(), and hits().
std::vector<float> RecHitsSortedInPhi::drphi |
Definition at line 104 of file RecHitsSortedInPhi.h.
Referenced by HitPairGeneratorFromLayerPair::doublets(), and RecHitsSortedInPhi().
std::vector<float> RecHitsSortedInPhi::du |
Definition at line 109 of file RecHitsSortedInPhi.h.
Referenced by HitPairGeneratorFromLayerPair::doublets(), and RecHitsSortedInPhi().
std::vector<float> RecHitsSortedInPhi::dv |
Definition at line 110 of file RecHitsSortedInPhi.h.
Referenced by HitPairGeneratorFromLayerPair::doublets(), and RecHitsSortedInPhi().
Definition at line 99 of file RecHitsSortedInPhi.h.
Referenced by HitPairGeneratorFromLayerPair::doublets(), gv(), RecHitsSortedInPhi(), and rv().
Definition at line 98 of file RecHitsSortedInPhi.h.
std::vector<float> RecHitsSortedInPhi::lphi |
Definition at line 111 of file RecHitsSortedInPhi.h.
Referenced by RecHitsSortedInPhi().
std::vector<HitWithPhi> RecHitsSortedInPhi::theHits |
Definition at line 96 of file RecHitsSortedInPhi.h.
Referenced by all(), doubleRange(), HitPairGeneratorFromLayerPair::doublets(), empty(), hits(), phi(), RecHitsSortedInPhi(), size(), and unsafeRange().
GlobalPoint RecHitsSortedInPhi::theOrigin [mutable] |
Definition at line 94 of file RecHitsSortedInPhi.h.
Referenced by LayerHitMapCache::operator()().
std::vector<float> RecHitsSortedInPhi::u |
Definition at line 107 of file RecHitsSortedInPhi.h.
Referenced by RecHitsSortedInPhi(), and rv().
std::vector<float> RecHitsSortedInPhi::v |
Definition at line 108 of file RecHitsSortedInPhi.h.
Referenced by RecHitsSortedInPhi(), and rv().
std::vector<float> RecHitsSortedInPhi::x |
Definition at line 101 of file RecHitsSortedInPhi.h.
Referenced by HitPairGeneratorFromLayerPair::doublets(), gp(), and RecHitsSortedInPhi().
std::vector<float> RecHitsSortedInPhi::y |
Definition at line 102 of file RecHitsSortedInPhi.h.
Referenced by HitPairGeneratorFromLayerPair::doublets(), gp(), and RecHitsSortedInPhi().
std::vector<float> RecHitsSortedInPhi::z |
Definition at line 103 of file RecHitsSortedInPhi.h.
Referenced by HitPairGeneratorFromLayerPair::doublets(), gp(), gv(), and RecHitsSortedInPhi().