CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
CTPPSPixelDigiCollection Class Reference

#include <CTPPSPixelDigiCollection.h>

Public Types

typedef std::vector< CTPPSPixelDigi >::const_iterator ContainerIterator
 
typedef std::pair< unsigned int, unsigned int > IndexRange
 
typedef std::pair< ContainerIterator, ContainerIteratorRange
 
typedef std::map< unsigned int, IndexRangeRegistry
 
typedef std::map< unsigned int, IndexRange >::const_iterator RegistryIterator
 

Public Member Functions

 CTPPSPixelDigiCollection ()
 
const std::vector< unsigned int > detIDs () const
 
const Range get (unsigned int detID) const
 
void put (Range input, unsigned int detID)
 

Private Attributes

std::vector< CTPPSPixelDigicontainer_
 
Registry map_
 

Detailed Description

Definition at line 9 of file CTPPSPixelDigiCollection.h.

Member Typedef Documentation

typedef std::vector<CTPPSPixelDigi>::const_iterator CTPPSPixelDigiCollection::ContainerIterator

Definition at line 13 of file CTPPSPixelDigiCollection.h.

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

Definition at line 15 of file CTPPSPixelDigiCollection.h.

Definition at line 14 of file CTPPSPixelDigiCollection.h.

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

Definition at line 16 of file CTPPSPixelDigiCollection.h.

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

Definition at line 17 of file CTPPSPixelDigiCollection.h.

Constructor & Destructor Documentation

CTPPSPixelDigiCollection::CTPPSPixelDigiCollection ( )
inline

Definition at line 19 of file CTPPSPixelDigiCollection.h.

References detIDs(), input, and put().

19 {}

Member Function Documentation

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

returns vector of detIDs in map

Definition at line 46 of file CTPPSPixelDigiCollection.cc.

References begin, end, map_, and convertSQLitetoXML_cfg::output.

Referenced by CTPPSPixelDigiCollection().

46  {
48 
49  auto begin = map_.begin();
50  auto end = map_.end();
51 
52  std::vector<unsigned int> output;
53  output.reserve(12);
54 
55  for (; begin != end; ++begin) {
56  output.push_back(begin->first);
57  }
58 
59  return output;
60 
61 }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
const CTPPSPixelDigiCollection::Range CTPPSPixelDigiCollection::get ( unsigned int  detID) const

get Digis of detID

Definition at line 30 of file CTPPSPixelDigiCollection.cc.

References container_, runEdmFileComparison::found, and map_.

Referenced by Options.Options::__getitem__(), betterConfigParser.BetterConfigParser::__updateDict(), util.rrapi.RRApi::columns(), rrapi.RRApi::columns(), util.rrapi.RRApi::count(), rrapi.RRApi::count(), rrapi.RRApi::data(), util.rrapi.RRApi::data(), betterConfigParser.BetterConfigParser::getCompares(), betterConfigParser.BetterConfigParser::getGeneral(), betterConfigParser.BetterConfigParser::getResultingSection(), rrapi.RRApi::report(), util.rrapi.RRApi::report(), rrapi.RRApi::reports(), util.rrapi.RRApi::reports(), util.rrapi.RRApi::tables(), rrapi.RRApi::tables(), rrapi.RRApi::tags(), util.rrapi.RRApi::tags(), rrapi.RRApi::templates(), util.rrapi.RRApi::templates(), util.rrapi.RRApi::workspaces(), and rrapi.RRApi::workspaces().

30  {
32 
33  auto found = map_.find(detID);
34  CTPPSPixelDigiCollection::IndexRange returnIndexRange{};
35  if(found != map_.end()) {
36  returnIndexRange = found->second;
37  }
38 
40  returnRange.first = container_.begin()+returnIndexRange.first;
41  returnRange.second = container_.begin()+returnIndexRange.second+1;
42 
43  return returnRange;
44 }
std::vector< CTPPSPixelDigi > container_
std::pair< ContainerIterator, ContainerIterator > Range
std::pair< unsigned int, unsigned int > IndexRange
void CTPPSPixelDigiCollection::put ( Range  input,
unsigned int  detID 
)

put in Digis of detID

store size of vector before put

fill input in temporary vector for sorting

fill map

Definition at line 5 of file CTPPSPixelDigiCollection.cc.

References begin, container_, end, estimatePileup::inputRange, and map_.

Referenced by CTPPSPixelDigiCollection().

5  {
7 
10 
12  std::vector<CTPPSPixelDigi> temporary;
13 
14  auto sort_begin = input.first;
15  auto sort_end = input.second;
16 
17  temporary.insert(std::end(temporary), sort_begin, sort_end);
18 
19  std::sort(temporary.begin(),temporary.end());
20 
21  inputRange.first=container_.size();
22  container_.insert(std::end(container_), std::begin(temporary), std::end(temporary));
23  inputRange.second = container_.size()-1;
24 
26  map_[detID] = inputRange;
27 
28 }
std::vector< CTPPSPixelDigi > container_
static std::string const input
Definition: EdmProvDump.cc:48
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
inputRange
Get input source.
std::pair< unsigned int, unsigned int > IndexRange

Member Data Documentation

std::vector<CTPPSPixelDigi> CTPPSPixelDigiCollection::container_
private

Definition at line 26 of file CTPPSPixelDigiCollection.h.

Referenced by get(), and put().

Registry CTPPSPixelDigiCollection::map_
private

Definition at line 27 of file CTPPSPixelDigiCollection.h.

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