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 60 of file HcalDigitizer.cc.

References python.multivaluedict::sort().

Referenced by HcalDigitizer::updateGeometry().

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

Definition at line 45 of file HcalDigitizer.cc.

Referenced by HcalDigitizer::HcalDigitizer().

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