CMS 3D CMS Logo

LASBeamProfileFitCollection Class Reference

Collection of LASBeamProfileFits. More...

#include <DataFormats/LaserAlignment/interface/LASBeamProfileFitCollection.h>

List of all members.

Public Types

typedef std::vector
< LASBeamProfileFit >
::const_iterator 
ContainerIterator
typedef std::pair< unsigned
int, unsigned int
IndexRange
typedef std::map< unsigned int,
std::vector
< LASBeamProfileFit > > 
LASBeamProfileFitContainer
typedef std::pair
< ContainerIterator,
ContainerIterator
Range
typedef std::map< unsigned int,
IndexRange
Registry
typedef std::map< unsigned int,
IndexRange >::const_iterator 
RegistryIterator

Public Member Functions

void add (unsigned int &det_id, std::vector< LASBeamProfileFit > &beamProfileFit)
 appends LASBeamProfileFit to the vector of the given DetId
void beamProfileFit (unsigned int &det_id, std::vector< LASBeamProfileFit > &beamProfileFit) const
 returns (by reference) the LASBeamProfileFit for a given DetId
void detIDs (std::vector< unsigned int > &det_ids) const
 returns (by reference) vector of DetIds with a LASBeamProfileFit
const std::vector< unsigned intdetIDs () const
 get vector with detIDs
const Range get (unsigned int detID) const
 get Range
 LASBeamProfileFitCollection ()
 constructor
void put (Range input, unsigned int detID)
 put new LASBeamProfileFit into the collection
int size () const
 return the number of entries in the collection

Private Attributes

std::vector< LASBeamProfileFitcontainer_
LASBeamProfileFitContainer fitMap_
Registry map_


Detailed Description

Collection of LASBeamProfileFits.

Date
2007/06/11 14:44:30
Revision
1.3
Author:
Maarten Thomas

Definition at line 16 of file LASBeamProfileFitCollection.h.


Member Typedef Documentation

typedef std::vector<LASBeamProfileFit>::const_iterator LASBeamProfileFitCollection::ContainerIterator

Definition at line 19 of file LASBeamProfileFitCollection.h.

typedef std::pair<unsigned int, unsigned int> LASBeamProfileFitCollection::IndexRange

Definition at line 21 of file LASBeamProfileFitCollection.h.

typedef std::map< unsigned int, std::vector<LASBeamProfileFit> > LASBeamProfileFitCollection::LASBeamProfileFitContainer

Definition at line 26 of file LASBeamProfileFitCollection.h.

typedef std::pair<ContainerIterator, ContainerIterator> LASBeamProfileFitCollection::Range

Definition at line 20 of file LASBeamProfileFitCollection.h.

typedef std::map<unsigned int, IndexRange> LASBeamProfileFitCollection::Registry

Definition at line 22 of file LASBeamProfileFitCollection.h.

typedef std::map<unsigned int, IndexRange>::const_iterator LASBeamProfileFitCollection::RegistryIterator

Definition at line 23 of file LASBeamProfileFitCollection.h.


Constructor & Destructor Documentation

LASBeamProfileFitCollection::LASBeamProfileFitCollection (  )  [inline]

constructor

Definition at line 29 of file LASBeamProfileFitCollection.h.

00029 {}


Member Function Documentation

void LASBeamProfileFitCollection::add ( unsigned int det_id,
std::vector< LASBeamProfileFit > &  beamProfileFit 
)

appends LASBeamProfileFit to the vector of the given DetId

Definition at line 68 of file LASBeamProfileFitCollection.cc.

References edmNew::copy(), empty, fitMap_, and size().

00069 {
00070   fitMap_[det_id].reserve( fitMap_[det_id].size() + beamProfileFit.size() );
00071 
00072   if ( fitMap_[det_id].empty() )
00073     {
00074       fitMap_[det_id] = beamProfileFit;
00075     }
00076   else
00077     {
00078       copy( beamProfileFit.begin(), beamProfileFit.end(), back_inserter(fitMap_[det_id]) );
00079     }
00080 }

void LASBeamProfileFitCollection::beamProfileFit ( unsigned int det_id,
std::vector< LASBeamProfileFit > &  beamProfileFit 
) const

returns (by reference) the LASBeamProfileFit for a given DetId

Definition at line 83 of file LASBeamProfileFitCollection.cc.

References fitMap_.

00084 {
00085   if ( fitMap_.find(det_id) != fitMap_.end() )
00086     {
00087       beamProfileFit = fitMap_[det_id];
00088     }
00089   else
00090     {
00091       beamProfileFit = std::vector<LASBeamProfileFit>();
00092     }
00093 }

void LASBeamProfileFitCollection::detIDs ( std::vector< unsigned int > &  det_ids  )  const

returns (by reference) vector of DetIds with a LASBeamProfileFit

Definition at line 96 of file LASBeamProfileFitCollection.cc.

References fitMap_, and iter.

00097 {
00098   det_ids.clear();
00099   det_ids.reserve(static_cast<unsigned int>(fitMap_.size()));
00100 
00101   LASBeamProfileFitContainer::const_iterator iter;
00102   for (iter = fitMap_.begin(); iter != fitMap_.end(); iter++)
00103     {
00104       det_ids.push_back( iter->first );
00105     }
00106 }

const std::vector< unsigned int > LASBeamProfileFitCollection::detIDs (  )  const

get vector with detIDs

Definition at line 52 of file LASBeamProfileFitCollection.cc.

References begin, end, map_, and output().

00053 {
00054   LASBeamProfileFitCollection::RegistryIterator begin = map_.begin();
00055   LASBeamProfileFitCollection::RegistryIterator end = map_.end();
00056 
00057   std::vector<unsigned int> output;
00058 
00059   for ( ; begin != end; ++begin)
00060     {
00061       output.push_back(begin->first);
00062     }
00063 
00064   return output;
00065 }

const LASBeamProfileFitCollection::Range LASBeamProfileFitCollection::get ( unsigned int  detID  )  const

get Range

Definition at line 40 of file LASBeamProfileFitCollection.cc.

References container_, and map_.

Referenced by LaserClusterizerAlgorithm::run().

00041 {
00042   LASBeamProfileFitCollection::IndexRange returnIndexRange = map_[detID];
00043 
00044   LASBeamProfileFitCollection::Range returnRange;
00045   returnRange.first = container_.begin() + returnIndexRange.first;
00046   returnRange.second = container_.begin() + returnIndexRange.second;
00047 
00048   return returnRange;
00049 }

void LASBeamProfileFitCollection::put ( Range  input,
unsigned int  detID 
)

put new LASBeamProfileFit into the collection

Definition at line 12 of file LASBeamProfileFitCollection.cc.

References begin, container_, end, first, and map_.

00013 {
00014   // store size of vector before put
00015   IndexRange inputRange;
00016 
00017   // put in LASBeamProfileFit from input
00018   bool first = true;
00019 
00020   // iterators over input
00021   LASBeamProfileFitCollection::ContainerIterator begin = input.first;
00022   LASBeamProfileFitCollection::ContainerIterator end = input.second;
00023 
00024   for ( ; begin != end; ++begin)
00025     {
00026       container_.push_back(*begin);
00027       if (first)
00028         {
00029           inputRange.first = container_.size() - 1;
00030           first = false;
00031         }
00032     }
00033   inputRange.second = container_.size() - 1;
00034 
00035   // fill map
00036   map_[detID] = inputRange;
00037 }

int LASBeamProfileFitCollection::size ( void   )  const

return the number of entries in the collection

Definition at line 109 of file LASBeamProfileFitCollection.cc.

References map_.

Referenced by add().

00110 {
00111   return map_.size();
00112 }


Member Data Documentation

std::vector<LASBeamProfileFit> LASBeamProfileFitCollection::container_ [mutable, private]

Definition at line 50 of file LASBeamProfileFitCollection.h.

Referenced by get(), and put().

LASBeamProfileFitContainer LASBeamProfileFitCollection::fitMap_ [mutable, private]

Definition at line 54 of file LASBeamProfileFitCollection.h.

Referenced by add(), beamProfileFit(), and detIDs().

Registry LASBeamProfileFitCollection::map_ [mutable, private]

Definition at line 51 of file LASBeamProfileFitCollection.h.

Referenced by detIDs(), get(), put(), and size().


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