CMS 3D CMS Logo

Ring Class Reference

#include <RecoTracker/RingRecord/interface/Ring.h>

List of all members.

Public Types

typedef DetIdMap::const_iterator const_iterator
typedef std::pair
< const_iterator,
const_iterator
ConstIteratorRange
typedef std::multimap< double,
DetId
DetIdMap
typedef DetIdMap::iterator iterator
typedef std::pair< iterator,
iterator
IteratorRange
enum  type {
  TIBRing, TOBRing, TIDRing, TECRing,
  PXBRing, PXFRing, Unspecified
}

Public Member Functions

void addId (double phi, DetId id)
iterator begin ()
const_iterator begin () const
bool containsDetId (DetId id, double phi=999999., double dphi_scalefactor=1.5) const
std::string dump () const
iterator end ()
const_iterator end () const
DetIdMap getDetIdMap () const
DetId getFirst () const
unsigned int getindex () const
int getNumDetIds () const
float getrmax () const
float getrmin () const
type getType () const
float getzmax () const
float getzmin () const
void initialize (float rmin, float rmax, float zmin, float zmax)
bool isInitialized () const
const_iterator lower_bound (double phi) const
double map_phi (double phi) const
void notInitializedMsg () const
int operator!= (const Ring &ring) const
 inequality
int operator< (const Ring &ring) const
 comparison
int operator== (const Ring &ring) const
 equality
std::string print () const
 Ring (Ring *input)
 Ring (unsigned int index, float rmin, float rmax, float zmin, float zmax, unsigned int type)
 Ring (type input)
 Ring ()
void setindex (unsigned int input)
void setInitialized (bool input)
void setrmax (float input)
void setrmin (float input)
void setType (type input)
void setzmax (float input)
void setzmin (float input)
const_iterator upper_bound (double phi) const
 ~Ring ()

Private Attributes

DetIdMap detids_
unsigned int index_
bool initialized_
float rmax_
float rmin_
type type_
float zmax_
float zmin_


Detailed Description

Definition at line 31 of file Ring.h.


Member Typedef Documentation

typedef DetIdMap::const_iterator Ring::const_iterator

Definition at line 37 of file Ring.h.

typedef std::pair<const_iterator,const_iterator> Ring::ConstIteratorRange

Definition at line 39 of file Ring.h.

typedef std::multimap<double,DetId> Ring::DetIdMap

Definition at line 35 of file Ring.h.

typedef DetIdMap::iterator Ring::iterator

Definition at line 36 of file Ring.h.

typedef std::pair<iterator,iterator> Ring::IteratorRange

Definition at line 38 of file Ring.h.


Member Enumeration Documentation

enum Ring::type

Enumerator:
TIBRing 
TOBRing 
TIDRing 
TECRing 
PXBRing 
PXFRing 
Unspecified 

Definition at line 41 of file Ring.h.

00041             {
00042     TIBRing,
00043     TOBRing,
00044     TIDRing,
00045     TECRing,
00046     PXBRing,
00047     PXFRing,
00048     Unspecified
00049   };


Constructor & Destructor Documentation

Ring::Ring (  )  [inline]

Definition at line 51 of file Ring.h.

00051          : initialized_(false), 
00052            rmin_(0.), 
00053            rmax_(0.), 
00054            zmin_(0.), 
00055            zmax_(0.), 
00056            type_(Unspecified), 
00057            index_(0) {}

Ring::Ring ( type  input  )  [inline]

Definition at line 59 of file Ring.h.

00059                    : initialized_(false), 
00060                      rmin_(0.), 
00061                      rmax_(0.), 
00062                      zmin_(0.), 
00063                      zmax_(0.), 
00064                      type_(input), 
00065                      index_(0) {}

Ring::Ring ( unsigned int  index,
float  rmin,
float  rmax,
float  zmin,
float  zmax,
unsigned int  type 
) [inline]

Definition at line 67 of file Ring.h.

References PXBRing, PXFRing, TECRing, TOBRing, type_, and Unspecified.

00072                           : initialized_(true), 
00073                             rmin_(rmin), 
00074                             rmax_(rmax), 
00075                             zmin_(zmin), 
00076                             zmax_(zmax), 
00077                             index_(index) {
00078     if ( type == 0 ) {
00079       type_ = TIBRing;
00080     } else if ( type == 1 ) {
00081       type_ = TOBRing;
00082     } else if ( type == 2 ) {
00083       type_ = TIDRing;
00084     } else if ( type == 3 ) {
00085       type_ = TECRing;
00086     } else if ( type == 4 ) {
00087       type_ = PXBRing;
00088     } else if ( type == 5 ) {
00089       type_ = PXFRing;
00090     } else {
00091       type_ = Unspecified;
00092     } 
00093   }

Ring::Ring ( Ring input  )  [inline]

Definition at line 95 of file Ring.h.

00095                     : detids_(input->getDetIdMap()), 
00096                       initialized_(input->isInitialized()), 
00097                       rmin_(input->getrmin()), 
00098                       rmax_(input->getrmax()), 
00099                       zmin_(input->getzmin()), 
00100                       zmax_(input->getzmax()), 
00101                       type_(input->getType()), 
00102                       index_(input->getindex()) {}

Ring::~Ring (  )  [inline]

Definition at line 104 of file Ring.h.

00104 {}


Member Function Documentation

void Ring::addId ( double  phi,
DetId  id 
) [inline]

Definition at line 106 of file Ring.h.

References detids_.

Referenced by RingMaker::constructPXBRing(), RingMaker::constructPXFRing(), RingMaker::constructTECRing(), RingMaker::constructTIBRing(), RingMaker::constructTIDRing(), RingMaker::constructTOBRing(), and Rings::readInFromAsciiFile().

00106 { detids_.insert(std::make_pair(phi,id)); }

iterator Ring::begin ( void   )  [inline]

Definition at line 150 of file Ring.h.

References detids_.

00150 { return detids_.begin(); }

const_iterator Ring::begin ( void   )  const [inline]

Definition at line 147 of file Ring.h.

References detids_.

Referenced by RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerOneOuter(), RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerTwoOuter(), and RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsTwoInnerOneOuter().

00147 { return detids_.begin(); }

bool Ring::containsDetId ( DetId  id,
double  phi = 999999.,
double  dphi_scalefactor = 1.5 
) const [inline]

Definition at line 110 of file Ring.h.

References kinem::delta_phi(), detids_, map_phi(), phi, Geom::pi(), and Geom::twoPi().

00111                                                                  {
00112     // calculate window around given phi (if phi == 999999. set window to [-pi,pi])
00113     // determine phi segmentation from number of detids in ring
00114     // window is += 1.5 times the phi segmentation
00115     double phi_inner = -Geom::pi();
00116     double phi_outer =  Geom::pi();
00117     double delta_phi = Geom::twoPi() / detids_.size();
00118     if ( phi != 999999. ) {
00119       phi_inner = map_phi(phi - dphi_scalefactor*delta_phi);
00120       phi_outer = map_phi(phi + dphi_scalefactor*delta_phi);
00121     }
00122 
00123     // check for out of bounds of [0,2pi]
00124     if ( phi_inner > phi_outer ) {
00125       // double loop
00126       for ( const_iterator ring = detids_.lower_bound(phi_inner); ring != detids_.end(); ++ring ) {
00127         if ( id == ring->second ) {
00128           return true;
00129         }
00130       }
00131       for ( const_iterator ring = detids_.begin(); ring != detids_.upper_bound(phi_outer); ++ring ) {
00132         if ( id == ring->second ) {
00133           return true;
00134         }
00135       }
00136     } else {
00137       for ( const_iterator ring = detids_.lower_bound(phi_inner); ring != detids_.upper_bound(phi_outer); ++ring ) {
00138         if ( id == ring->second ) {
00139           return true;
00140         }
00141       }
00142     }
00143 
00144     return false;
00145   }

std::string Ring::dump ( void   )  const [inline]

Definition at line 207 of file Ring.h.

References detids_, lat::endl(), index_, rmax_, rmin_, type_, zmax_, and zmin_.

00207                                 {
00208     std::ostringstream stream;
00209     stream << "### Ring with index: " << index_ << " ###" << std::endl;
00210     stream << index_
00211            << " " << rmin_
00212            << " " << rmax_
00213            << " " << zmin_
00214            << " " << zmax_ 
00215            << " " << type_ << std::endl;
00216     stream << detids_.size() << std::endl;
00217     for ( const_iterator entry = detids_.begin(); entry != detids_.end(); ++entry ) {
00218       stream << entry->first << " " << entry->second.rawId() << std::endl;
00219     }
00220     return stream.str();
00221   }

iterator Ring::end ( void   )  [inline]

Definition at line 151 of file Ring.h.

References detids_.

00151 { return detids_.end();   }

const_iterator Ring::end ( void   )  const [inline]

Definition at line 148 of file Ring.h.

References detids_.

Referenced by RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerOneOuter(), RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerTwoOuter(), and RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsTwoInnerOneOuter().

00148 { return detids_.end();   }

DetIdMap Ring::getDetIdMap (  )  const [inline]

Definition at line 187 of file Ring.h.

References detids_.

00187 { return detids_; }

DetId Ring::getFirst (  )  const [inline]

Definition at line 181 of file Ring.h.

References detids_.

Referenced by RoadMaker::RingInBarrel(), RoadSearchSeedFinderAlgorithm::ringsOnSameLayer(), and RoadMaker::RingsOnSameLayer().

00181 { return detids_.begin()->second; }

unsigned int Ring::getindex (  )  const [inline]

Definition at line 185 of file Ring.h.

References index_.

Referenced by RoadMaker::collectInnerTECSeedRings(), RoadMaker::collectInnerTECSeedRings1(), RoadMaker::collectInnerTECSeedRings2(), RoadMaker::collectInnerTIBSeedRings(), RoadMaker::collectInnerTIBSeedRings1(), RoadMaker::collectInnerTIBSeedRings2(), RoadMaker::collectInnerTIDSeedRings(), RoadMaker::collectInnerTIDSeedRings1(), RoadMaker::collectInnerTIDSeedRings2(), RoadMaker::collectInnerTOBSeedRings(), RoadMaker::collectInnerTOBSeedRings1(), RoadMaker::collectInnerTOBSeedRings2(), RoadMaker::collectOuterTECSeedRings(), RoadMaker::collectOuterTECSeedRings1(), RoadMaker::collectOuterTIBSeedRings(), RoadMaker::collectOuterTIBSeedRings1(), RoadMaker::collectOuterTOBSeedRings(), RoadMaker::collectOuterTOBSeedRings1(), RingMaker::constructPXBRings(), RingMaker::constructTECRings(), RingMaker::constructTIBRings(), RingMaker::constructTIDRings(), RingMaker::constructTOBRings(), SortLayersByZR::LayersSortedInZR(), operator!=(), operator<(), operator==(), and SortRingsByZR::RingsSortedInZR().

00185 { return index_; }

int Ring::getNumDetIds (  )  const [inline]

Definition at line 108 of file Ring.h.

References detids_.

Referenced by RingMaker::constructPXBRings(), RingMaker::constructPXFRings(), RingMaker::constructTECRings(), RingMaker::constructTIBRings(), RingMaker::constructTIDRings(), and RingMaker::constructTOBRings().

00108 { return detids_.size(); }

float Ring::getrmax (  )  const [inline]

Definition at line 156 of file Ring.h.

References isInitialized(), notInitializedMsg(), and rmax_.

Referenced by RoadMaker::CompatibleWithLines(), RoadMaker::LinesThroughRingAndBS(), and RoadMaker::LinesThroughRings().

00156 { if ( !isInitialized() ) notInitializedMsg(); return rmax_; }

float Ring::getrmin (  )  const [inline]

Definition at line 155 of file Ring.h.

References isInitialized(), notInitializedMsg(), and rmin_.

Referenced by RoadMaker::CompatibleWithLines(), RoadMaker::LinesThroughRingAndBS(), and RoadMaker::LinesThroughRings().

00155 { if ( !isInitialized() ) notInitializedMsg(); return rmin_; }

type Ring::getType (  )  const [inline]

Definition at line 179 of file Ring.h.

References type_.

00179 { return type_; }

float Ring::getzmax (  )  const [inline]

Definition at line 158 of file Ring.h.

References isInitialized(), notInitializedMsg(), and zmax_.

Referenced by RoadMaker::CompatibleWithLines(), RingMaker::constructPXBRings(), RingMaker::constructPXFRings(), RingMaker::constructTECRings(), RingMaker::constructTIBRings(), RingMaker::constructTIDRings(), RingMaker::constructTOBRings(), RoadMaker::LinesThroughRingAndBS(), and RoadMaker::LinesThroughRings().

00158 { if ( !isInitialized() ) notInitializedMsg(); return zmax_; }

float Ring::getzmin (  )  const [inline]

Definition at line 157 of file Ring.h.

References isInitialized(), notInitializedMsg(), and zmin_.

Referenced by RoadMaker::CompatibleWithLines(), RingMaker::constructPXBRings(), RingMaker::constructPXFRings(), RingMaker::constructTECRings(), RingMaker::constructTIBRings(), RingMaker::constructTIDRings(), RingMaker::constructTOBRings(), RoadMaker::LinesThroughRingAndBS(), and RoadMaker::LinesThroughRings().

00157 { if ( !isInitialized() ) notInitializedMsg(); return zmin_; }

void Ring::initialize ( float  rmin,
float  rmax,
float  zmin,
float  zmax 
) [inline]

Definition at line 167 of file Ring.h.

References initialized_, rmax_, rmin_, zmax_, and zmin_.

Referenced by RingMaker::constructPXBRing(), RingMaker::constructPXFRing(), RingMaker::constructTECRing(), RingMaker::constructTIBRing(), RingMaker::constructTIDRing(), and RingMaker::constructTOBRing().

00167                                                                          { 
00168     rmin_ = rmin; 
00169     rmax_ = rmax; 
00170     zmin_ = zmin; 
00171     zmax_ = zmax; 
00172     initialized_ = true; }

bool Ring::isInitialized (  )  const [inline]

Definition at line 153 of file Ring.h.

References initialized_.

Referenced by getrmax(), getrmin(), getzmax(), and getzmin().

00153 { return initialized_; }

const_iterator Ring::lower_bound ( double  phi  )  const [inline]

Definition at line 223 of file Ring.h.

References detids_.

Referenced by RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerOneOuter(), RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerTwoOuter(), and RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsTwoInnerOneOuter().

00223 { return detids_.lower_bound(phi); }

double Ring::map_phi ( double  phi  )  const [inline]

Definition at line 226 of file Ring.h.

References Geom::pi(), HLT_VtxMuL3::result, and Geom::twoPi().

Referenced by containsDetId().

00226                                           {
00227     // map phi to [-pi,pi]
00228     double result = phi;
00229     if ( result < -Geom::pi()) result += Geom::twoPi();
00230     if ( result >  Geom::pi()) result -= Geom::twoPi();
00231     return result;
00232   }

void Ring::notInitializedMsg (  )  const [inline]

Definition at line 174 of file Ring.h.

References index_.

Referenced by getrmax(), getrmin(), getzmax(), and getzmin().

00174                                         { 
00175     edm::LogWarning("RoadSearch") << "Ring " << index_ << " does not have initialized values for r_min, r_max, z_min, z_max! Using default value of 0. !"; }

int Ring::operator!= ( const Ring ring  )  const [inline]

inequality

Definition at line 192 of file Ring.h.

References getindex(), and index_.

00192 { return index_!=ring.getindex(); }

int Ring::operator< ( const Ring ring  )  const [inline]

comparison

Definition at line 194 of file Ring.h.

References getindex(), and index_.

00194 { return index_<ring.getindex(); }

int Ring::operator== ( const Ring ring  )  const [inline]

equality

Definition at line 190 of file Ring.h.

References getindex(), and index_.

00190 { return index_==ring.getindex(); }

std::string Ring::print ( void   )  const [inline]

Definition at line 196 of file Ring.h.

References detids_, index_, rmax_, rmin_, zmax_, and zmin_.

00196                                  {
00197     std::ostringstream stream;
00198     stream << "Ring: " << index_
00199            << " rmin: " << rmin_
00200            << " rmax: " << rmax_
00201            << " zmin: " << zmin_
00202            << " zmax: " << zmax_
00203            << " number of DetUnits: " << detids_.size();
00204     return stream.str();
00205   }

void Ring::setindex ( unsigned int  input  )  [inline]

Definition at line 183 of file Ring.h.

References index_.

Referenced by RingMaker::constructPXBRings(), RingMaker::constructPXFRings(), RingMaker::constructTECRings(), RingMaker::constructTIBRings(), RingMaker::constructTIDRings(), and RingMaker::constructTOBRings().

00183 { index_ = input; }

void Ring::setInitialized ( bool  input  )  [inline]

Definition at line 165 of file Ring.h.

References initialized_.

00165 { initialized_ = input; }

void Ring::setrmax ( float  input  )  [inline]

Definition at line 161 of file Ring.h.

References rmax_.

00161 { rmax_ = input; }

void Ring::setrmin ( float  input  )  [inline]

Definition at line 160 of file Ring.h.

References rmin_.

00160 { rmin_ = input; }

void Ring::setType ( type  input  )  [inline]

Definition at line 177 of file Ring.h.

References type_.

00177 { type_ = input; }

void Ring::setzmax ( float  input  )  [inline]

Definition at line 163 of file Ring.h.

References zmax_.

00163 { zmax_ = input; }

void Ring::setzmin ( float  input  )  [inline]

Definition at line 162 of file Ring.h.

References zmin_.

00162 { zmin_ = input; }

const_iterator Ring::upper_bound ( double  phi  )  const [inline]

Definition at line 224 of file Ring.h.

References detids_.

Referenced by RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerOneOuter(), RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsOneInnerTwoOuter(), and RoadSearchSeedFinderAlgorithm::calculateCircleSeedsFromRingsTwoInnerOneOuter().

00224 { return detids_.upper_bound(phi); }


Member Data Documentation

DetIdMap Ring::detids_ [private]

Definition at line 236 of file Ring.h.

Referenced by addId(), begin(), containsDetId(), dump(), end(), getDetIdMap(), getFirst(), getNumDetIds(), lower_bound(), print(), and upper_bound().

unsigned int Ring::index_ [private]

Definition at line 247 of file Ring.h.

Referenced by dump(), getindex(), notInitializedMsg(), operator!=(), operator<(), operator==(), print(), and setindex().

bool Ring::initialized_ [private]

Definition at line 238 of file Ring.h.

Referenced by initialize(), isInitialized(), and setInitialized().

float Ring::rmax_ [private]

Definition at line 241 of file Ring.h.

Referenced by dump(), getrmax(), initialize(), print(), and setrmax().

float Ring::rmin_ [private]

Definition at line 240 of file Ring.h.

Referenced by dump(), getrmin(), initialize(), print(), and setrmin().

type Ring::type_ [private]

Definition at line 245 of file Ring.h.

Referenced by dump(), getType(), Ring(), and setType().

float Ring::zmax_ [private]

Definition at line 243 of file Ring.h.

Referenced by dump(), getzmax(), initialize(), print(), and setzmax().

float Ring::zmin_ [private]

Definition at line 242 of file Ring.h.

Referenced by dump(), getzmin(), initialize(), print(), and setzmin().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:30:47 2009 for CMSSW by  doxygen 1.5.4