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

References python.multivaluedict::sort().

Referenced by HcalDigitizer::updateGeometry().

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

Definition at line 42 of file HcalDigitizer.cc.

Referenced by HcalDigitizer::HcalDigitizer().

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