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

◆ ContainerIterator

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

Definition at line 11 of file CTPPSPixelDigiCollection.h.

◆ IndexRange

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

Definition at line 13 of file CTPPSPixelDigiCollection.h.

◆ Range

Definition at line 12 of file CTPPSPixelDigiCollection.h.

◆ Registry

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

Definition at line 14 of file CTPPSPixelDigiCollection.h.

◆ RegistryIterator

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

Definition at line 15 of file CTPPSPixelDigiCollection.h.

Constructor & Destructor Documentation

◆ CTPPSPixelDigiCollection()

CTPPSPixelDigiCollection::CTPPSPixelDigiCollection ( )
inline

Definition at line 17 of file CTPPSPixelDigiCollection.h.

17 {}

Member Function Documentation

◆ detIDs()

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

returns vector of detIDs in map

Definition at line 45 of file CTPPSPixelDigiCollection.cc.

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

45  {
47 
48  auto begin = map_.begin();
49  auto end = map_.end();
50 
51  std::vector<unsigned int> output;
52  output.reserve(12);
53 
54  for (; begin != end; ++begin) {
55  output.push_back(begin->first);
56  }
57 
58  return output;
59 }

◆ get()

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

get Digis of detID

Definition at line 29 of file CTPPSPixelDigiCollection.cc.

References container_, newFWLiteAna::found, and map_.

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

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

◆ put()

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 container_, input, pileupCalc::inputRange, map_, and jetUpdater_cfi::sort.

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 }
std::vector< CTPPSPixelDigi > container_
static std::string const input
Definition: EdmProvDump.cc:50
std::pair< unsigned int, unsigned int > IndexRange

Member Data Documentation

◆ container_

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

Definition at line 24 of file CTPPSPixelDigiCollection.h.

Referenced by get(), and put().

◆ map_

Registry CTPPSPixelDigiCollection::map_
private

Definition at line 25 of file CTPPSPixelDigiCollection.h.

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