CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

TrackCollectionFP420 Class Reference

#include <TrackCollectionFP420.h>

List of all members.

Public Types

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

Public Member Functions

void clear ()
const Range get (unsigned int stationID) const
void put (Range input, unsigned int stationID)
void putclear (Range input, unsigned int stationID)
const std::vector< unsigned int > stationIDs () const
 TrackCollectionFP420 ()

Private Attributes

std::vector< TrackFP420container_
Registry map_
TrackFP420Container trackMap_

Detailed Description

Definition at line 9 of file TrackCollectionFP420.h.


Member Typedef Documentation

typedef std::vector<TrackFP420>::const_iterator TrackCollectionFP420::ContainerIterator

Definition at line 13 of file TrackCollectionFP420.h.

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

Definition at line 15 of file TrackCollectionFP420.h.

Definition at line 14 of file TrackCollectionFP420.h.

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

Definition at line 16 of file TrackCollectionFP420.h.

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

Definition at line 17 of file TrackCollectionFP420.h.

typedef std::map< unsigned int, std::vector<TrackFP420> > TrackCollectionFP420::TrackFP420Container

Definition at line 18 of file TrackCollectionFP420.h.


Constructor & Destructor Documentation

TrackCollectionFP420::TrackCollectionFP420 ( ) [inline]

Definition at line 20 of file TrackCollectionFP420.h.

{}

Member Function Documentation

void TrackCollectionFP420::clear ( void  )

Definition at line 101 of file TrackCollectionFP420.cc.

References container_.

                                 {
container_.clear();
}
const TrackCollectionFP420::Range TrackCollectionFP420::get ( unsigned int  stationID) const

Definition at line 71 of file TrackCollectionFP420.cc.

References container_, and gather_cfg::cout.

                                                                                      {
  // get RecHits of stationID

#ifdef mydigidebug
std::cout <<"TrackCollectionFP420::get:stationID= " << stationID << std::endl;
#endif
  TrackCollectionFP420::RegistryIterator returnIndex = map_.find(stationID);
  TrackCollectionFP420::IndexRange returnIndexRange = returnIndex->second;
#ifdef mydigidebug
   std::cout <<"TrackCollectionFP420::get1: returnIndexRange.first= " << returnIndexRange.first << std::endl;
   std::cout <<"TrackCollectionFP420::get1: returnIndexRange.second= " << returnIndexRange.second << std::endl;
#endif

  TrackCollectionFP420::Range returnRange;
  returnRange.first  = container_.begin()+returnIndexRange.first;
  if(returnIndexRange.second != 0 ) {
    returnRange.second = container_.begin()+returnIndexRange.second+1;
  }else{
    returnRange.second = container_.begin()+returnIndexRange.second;
  }
#ifdef mydigidebug
   std::cout <<"TrackCollectionFP420::get2: container_.size() = " << container_.size() << std::endl;
   std::cout <<"TrackCollectionFP420::get2: returnIndexRange.first= " << returnIndexRange.first << std::endl;
   std::cout <<"TrackCollectionFP420::get2: returnIndexRange.second= " << returnIndexRange.second << std::endl;
#endif
  return returnRange;
}
void TrackCollectionFP420::put ( TrackCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 13 of file TrackCollectionFP420.cc.

References begin, container_, gather_cfg::cout, end, first, estimatePileup::inputRange, and python::multivaluedict::sort().

                                                                                      {
  // put in RecHits of stationID

  // store size of vector before put
  TrackCollectionFP420::IndexRange inputRange;
  
  // put in TrackFP420s from input
  bool first = true;
  
  // fill input in temporary vector for sorting
  std::vector<TrackFP420> temporary;
  TrackCollectionFP420::ContainerIterator sort_begin = input.first;
  TrackCollectionFP420::ContainerIterator sort_end = input.second;
#ifdef mydigidebug
   std::cout <<"   !!!!!!!!!!!!!!!!    TrackCollectionFP420:: !!!!  put !!!!           start " << std::endl;
#endif
  for ( ;sort_begin != sort_end; ++sort_begin ) {
#ifdef mydigidebug
   std::cout <<"put: temporary.push_back " << std::endl;
#endif
    temporary.push_back(*sort_begin);
  }
  std::sort(temporary.begin(),temporary.end());

  // iterators over input
  TrackCollectionFP420::ContainerIterator begin = temporary.begin();
  TrackCollectionFP420::ContainerIterator end = temporary.end();
  for ( ;begin != end; ++begin ) {
    container_.push_back(*begin);
    if ( first ) {
          inputRange.first = container_.size()-1;
 //     inputRange.first = container_.size();
      first = false;
    }
  }

  // since we start from 0, then the last element will be size-1
  if(container_.size() != 0) {
    inputRange.second = container_.size()-1;
  }
  else {
    inputRange.first = container_.size();
    inputRange.second = container_.size();
  }
  //inputRange.second = container_.size()-1;

#ifdef mydigidebug
   std::cout <<"put: container_.size() = " << container_.size() << std::endl;
   std::cout <<"put:  inputRange.first = " << inputRange.first << std::endl;
   std::cout <<"put:  inputRange.second = " << inputRange.second << std::endl;
#endif
  
  // fill map
  map_[stationID] = inputRange;

}
void TrackCollectionFP420::putclear ( TrackCollectionFP420::Range  input,
unsigned int  stationID 
)

Definition at line 104 of file TrackCollectionFP420.cc.

References begin, container_, gather_cfg::cout, end, estimatePileup::inputRange, and python::multivaluedict::sort().

                                                                                           {

  TrackCollectionFP420::IndexRange inputRange;
  
  std::vector<TrackFP420> temporary;
  TrackCollectionFP420::ContainerIterator sort_begin = input.first;
  TrackCollectionFP420::ContainerIterator sort_end = input.second;
  for ( ;sort_begin != sort_end; ++sort_begin ) {
    temporary.push_back(*sort_begin);
  }
  std::sort(temporary.begin(),temporary.end());

  //    temporary.clear();
  TrackCollectionFP420::ContainerIterator begin = temporary.begin();
  TrackCollectionFP420::ContainerIterator end = temporary.end();
  for ( ;begin != end; ++begin ) {
    container_.push_back(*begin);
  }
  //container_.clear();
          inputRange.first = container_.size()-container_.size();
          inputRange.second = container_.size()-container_.size();

#ifdef mydigidebug
   std::cout <<"putclear: container_.size() = " << container_.size() << std::endl;
   std::cout <<"putclear:  inputRange.first = " << inputRange.first << std::endl;
   std::cout <<"putclear:  inputRange.second = " << inputRange.second << std::endl;
#endif


          map_[stationID] = inputRange;
}
const std::vector< unsigned int > TrackCollectionFP420::stationIDs ( ) const

Definition at line 141 of file TrackCollectionFP420.cc.

References begin, gather_cfg::cout, end, and convertSQLitetoXML_cfg::output.

                                                                     {
  // returns vector of stationIDs in map

#ifdef mydigidebug
std::cout <<"TrackCollectionFP420::stationIDs:start " << std::endl;
#endif
  TrackCollectionFP420::RegistryIterator begin = map_.begin();
  TrackCollectionFP420::RegistryIterator end   = map_.end();

  std::vector<unsigned int> output;

  for (; begin != end; ++begin) {
    output.push_back(begin->first);
  }

  return output;

}

Member Data Documentation

std::vector<TrackFP420> TrackCollectionFP420::container_ [mutable, private]

Definition at line 38 of file TrackCollectionFP420.h.

Definition at line 39 of file TrackCollectionFP420.h.

Definition at line 41 of file TrackCollectionFP420.h.