CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
HcalDigitizerImpl Namespace Reference

Functions

template<typename HPDDIGITIZER , typename SIPMDIGITIZER >
void fillCells (std::vector< DetId > &allCells, HPDDIGITIZER *hpdDigitizer, SIPMDIGITIZER *siPMDigitizer)
 
template<typename SIPMDIGITIZER >
void fillSiPMCells (std::vector< int > &siPMCells, SIPMDIGITIZER *siPMDigitizer)
 

Function Documentation

template<typename HPDDIGITIZER , typename SIPMDIGITIZER >
void HcalDigitizerImpl::fillCells ( std::vector< DetId > &  allCells,
HPDDIGITIZER *  hpdDigitizer,
SIPMDIGITIZER *  siPMDigitizer 
)

Definition at line 58 of file HcalDigitizer.cc.

References python.multivaluedict::sort().

Referenced by HcalDigitizer::updateGeometry().

61  {
62  // if both digitizers exist, split up the cells
63  if(siPMDigitizer && hpdDigitizer)
64  {
65  std::vector<DetId> siPMDetIds = siPMDigitizer->detIds();
66  std::sort(siPMDetIds.begin(), siPMDetIds.end());
67  std::vector<DetId> sortedCells = allCells;
68  std::sort(sortedCells.begin(), sortedCells.end());
69  std::vector<DetId> hpdCells;
70  std::set_difference(sortedCells.begin(), sortedCells.end(),
71  siPMDetIds.begin(), siPMDetIds.end(),
72  std::back_inserter(hpdCells) );
73  hpdDigitizer->setDetIds(hpdCells);
74  }
75  else
76  {
77  if(siPMDigitizer) siPMDigitizer->setDetIds(allCells);
78  if(hpdDigitizer) hpdDigitizer->setDetIds(allCells);
79  }
80  }
template<typename SIPMDIGITIZER >
void HcalDigitizerImpl::fillSiPMCells ( std::vector< int > &  siPMCells,
SIPMDIGITIZER *  siPMDigitizer 
)

Definition at line 43 of file HcalDigitizer.cc.

Referenced by HcalDigitizer::HcalDigitizer().

44  {
45  std::vector<DetId> siPMDetIds;
46  siPMDetIds.reserve(siPMCells.size());
47  for(std::vector<int>::const_iterator idItr = siPMCells.begin();
48  idItr != siPMCells.end(); ++idItr)
49  {
50  siPMDetIds.emplace_back(*idItr);
51  }
52  siPMDigitizer->setDetIds(siPMDetIds);
53  }